Adding more exploration for execution paths.
[smartthings-infrastructure.git] / Runner.py
index 9c2da70..e82d1c2 100644 (file)
--- a/Runner.py
+++ b/Runner.py
@@ -229,11 +229,24 @@ for line in App2:
                Out.write("\t"+line)
 Out.write("}\n")
 Out.write("\n")
-Out.write("@Field def app1 = new App1(this)\n")
-Out.write("@Field def app2 = new App2(this)\n")
-Out.write("app1.installed()\n")
-Out.write("app2.installed()\n")
-Out.write("\n")
+Out.write("@Field def app1\n")
+Out.write("@Field def app2\n")
+Out.write("def initOrder = Verify.getBoolean()\n")
+Out.write("if (initOrder) {\n")
+Out.write("\tapp1 = new App1(this)\n")
+Out.write("\tapp2 = new App2(this)\n")
+Out.write("} else {\n")
+Out.write("\tapp2 = new App2(this)\n")
+Out.write("\tapp1 = new App1(this)\n")
+Out.write("}\n\n")
+Out.write("def installOrder = Verify.getBoolean()\n")
+Out.write("if (installOrder) {\n")
+Out.write("\tapp1.installed()\n")
+Out.write("\tapp2.installed()\n")
+Out.write("} else {\n")
+Out.write("\tapp1.installed()\n")
+Out.write("\tapp2.installed()\n")
+Out.write("}\n\n")
 for line in eventSimulator:
        Out.write(line)
 Out.close()