Use shlex.split() to parse --special-command test argument
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 16 Oct 2012 16:29:19 +0000 (16:29 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 16 Oct 2012 16:29:19 +0000 (16:29 +0000)
This allows passing commands with quoted spaces, such as:
  tools/test-wrapper-gypbuild.py --special-command \
    "$DR/bin64/drrun -ops '-reset_every_nth_pending 0' @" \
    ...

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/11143018
Patch from Reid Kleckner <rnk@google.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12744 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

tools/test.py

index 8c62136..b3b62b3 100755 (executable)
@@ -1371,8 +1371,9 @@ def GetSpecialCommandProcessor(value):
   else:
     pos = value.find('@')
     import urllib
-    prefix = urllib.unquote(value[:pos]).split()
-    suffix = urllib.unquote(value[pos+1:]).split()
+    import shlex
+    prefix = shlex.split(urllib.unquote(value[:pos]))
+    suffix = shlex.split(urllib.unquote(value[pos+1:]))
     def ExpandCommand(args):
       return prefix + args + suffix
     return ExpandCommand