[lldb-dotest] Wrap arguments in single quotes
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 20 Mar 2018 19:18:11 +0000 (19:18 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 20 Mar 2018 19:18:11 +0000 (19:18 +0000)
If we don't wrap arguments to the wrapper in single quotes, combined
arguments, for example for -E, don't reach dotest.py as a unit but as
separate arguments, causing the latter to fail.

llvm-svn: 328020

lldb/test/lldb-dotest.in

index b6a1080..08ae092 100755 (executable)
@@ -6,9 +6,13 @@ dotest_path = '@LLDB_SOURCE_DIR@/test/dotest.py'
 dotest_args = '@LLDB_DOTEST_ARGS_STR@'
 
 if __name__ == '__main__':
+    # Wrap arguments in single quotes. This is necessary because we want to
+    # forward the arguments and otherwise we might split up arguments that were
+    # originally wrapped in single quotes.
+    wrapper_args = list("'" + i + "'" for i in sys.argv[1:])
     # FIXME: It would be nice if we can mimic the approach taken by llvm-lit
     # and pass a python configuration straight to dotest, rather than going
     # through the operating system.
-    command = '{} -q {} {}'.format(dotest_path, dotest_args, ' '.join(
-        sys.argv[1:]))
+    command = '{} -q {} {}'.format(dotest_path, dotest_args,
+                                   ' '.join(wrapper_args))
     os.system(command)