[test-suite] r275311 - litsupport/remote.py: Fix preparescript handling

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 13:06:42 PDT 2016


Author: matze
Date: Wed Jul 13 15:06:41 2016
New Revision: 275311

URL: http://llvm.org/viewvc/llvm-project?rev=275311&view=rev
Log:
litsupport/remote.py: Fix preparescript handling

We need to put the prepare script in a different .sh file than the main
run script, so they don't override each other.

Modified:
    test-suite/trunk/litsupport/remote.py

Modified: test-suite/trunk/litsupport/remote.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/remote.py?rev=275311&r1=275310&r2=275311&view=diff
==============================================================================
--- test-suite/trunk/litsupport/remote.py (original)
+++ test-suite/trunk/litsupport/remote.py Wed Jul 13 15:06:41 2016
@@ -2,8 +2,8 @@ from litsupport import testplan
 import logging
 
 
-def mutateCommandline(context, commandline):
-    shfilename = context.tmpBase + ".sh"
+def mutateCommandline(context, commandline, suffix=""):
+    shfilename = context.tmpBase + suffix + ".sh"
     shfile = open(shfilename, "w")
     shfile.write(commandline + "\n")
     logging.info("Created shfile '%s'", shfilename)
@@ -22,10 +22,11 @@ def mutateCommandline(context, commandli
     return remote_commandline
 
 
-def mutateScript(context, script):
-    return testplan.mutateScript(context, script, mutateCommandline)
+def mutateScript(context, script, suffix=""):
+    mutate = lambda c, cmd: mutateCommandline(c, cmd, suffix)
+    return testplan.mutateScript(context, script, mutate)
 
 
 def mutatePlan(context, plan):
-    plan.preparescript = mutateScript(context, plan.preparescript)
+    plan.preparescript = mutateScript(context, plan.preparescript, "-prepare")
     plan.runscript = mutateScript(context, plan.runscript)




More information about the llvm-commits mailing list