[PATCH] D20854: [test-suite] Use shellcommand.wrap() when adding the run_under command

silviu.baranga@arm.com via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 04:39:37 PDT 2016


sbaranga updated this revision to Diff 59530.
sbaranga added a comment.

Raise an exception when the run_under command has any of the stdin, stdout, stderr, workdir or envvars set.


http://reviews.llvm.org/D20854

Files:
  litsupport/run_under.py

Index: litsupport/run_under.py
===================================================================
--- litsupport/run_under.py
+++ litsupport/run_under.py
@@ -3,7 +3,19 @@
 
 
 def mutateCommandLine(context, commandline):
-    return context.config.run_under + " " + commandline
+    cmd = shellcommand.parse(commandline)
+    run_under_cmd = shellcommand.parse(context.config.run_under)
+
+    if (run_under_cmd.stdin is not None or
+        run_under_cmd.stdout is not None or
+        run_under_cmd.stderr is not None or
+        run_under_cmd.workdir is not None or
+        run_under_cmd.envvars):
+        raise Exception("invalid run_under argument!")
+
+    cmd.wrap(run_under_cmd.executable, run_under_cmd.arguments)
+
+    return cmd.toCommandline()
 
 
 def mutatePlan(context, plan):


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20854.59530.patch
Type: text/x-patch
Size: 796 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160603/c6bd54d7/attachment.bin>


More information about the llvm-commits mailing list