Handle spaces in the working directory when running tests on Windows.
authorsgjesse@gmail.com <sgjesse@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 2 Sep 2008 14:47:10 +0000 (14:47 +0000)
committersgjesse@gmail.com <sgjesse@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 2 Sep 2008 14:47:10 +0000 (14:47 +0000)
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@100 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

tools/test.py

index 5d681da..8aecc48 100755 (executable)
@@ -299,11 +299,15 @@ INITIAL_SLEEP_TIME = 0.0001
 SLEEP_TIME_FACTOR = 1.25
 
 
-def RunProcess(context, timeout, **args):
-  if context.verbose: print "#", " ".join(args['args'])
+def RunProcess(context, timeout, args, **rest):
+  if context.verbose: print "#", " ".join(args)
+  popen_args = args
+  if platform.system() == 'Windows':
+    popen_args = '"' + subprocess.list2cmdline(args) + '"'
   process = subprocess.Popen(
     shell = (platform.system() == 'Windows'),
-    **args
+    args = popen_args,
+    **rest
   )
   # Compute the end time - if the process crosses this limit we
   # consider it timed out.