[Lldb-commits] [lldb] r155256 - in /lldb/branches/lldb-platform-work/test: lldbtest.py types/AbstractBase.py
Johnny Chen
johnny.chen at apple.com
Fri Apr 20 16:31:37 PDT 2012
Author: johnny
Date: Fri Apr 20 18:31:37 2012
New Revision: 155256
URL: http://llvm.org/viewvc/llvm-project?rev=155256&view=rev
Log:
Fix a syntax error -- left out an opening '('. Oops!
Plus need to tokenize the shell command string properly before passing the args to subprocess.Popen() constructor.
Modified:
lldb/branches/lldb-platform-work/test/lldbtest.py
lldb/branches/lldb-platform-work/test/types/AbstractBase.py
Modified: lldb/branches/lldb-platform-work/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lldbtest.py?rev=155256&r1=155255&r2=155256&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lldbtest.py (original)
+++ lldb/branches/lldb-platform-work/test/lldbtest.py Fri Apr 20 18:31:37 2012
@@ -1134,7 +1134,7 @@
# so that test cases can grab this thing out of the namespace.
#
lldb.lldbtest_remote_sandboxed_executable = target.replace(parent_dir, lldb.lldbtest_remote_sandbox)
- cmd = "file -P %s %s" % lldb.lldbtest_remote_sandboxed_executable, target)
+ cmd = "file -P %s %s" % (lldb.lldbtest_remote_sandboxed_executable, target)
print >> sbuf, "And this is the replaced file command: %s" % cmd
running = (cmd.startswith("run") or cmd.startswith("process launch"))
Modified: lldb/branches/lldb-platform-work/test/types/AbstractBase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/types/AbstractBase.py?rev=155256&r1=155255&r2=155256&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/types/AbstractBase.py (original)
+++ lldb/branches/lldb-platform-work/test/types/AbstractBase.py Fri Apr 20 18:31:37 2012
@@ -74,6 +74,7 @@
def generic_type_tester(self, exe_name, atoms, quotedDisplay=False, blockCaptured=False):
"""Test that variables with basic types are displayed correctly."""
+ import shlex
self.runCmd("file %s" % exe_name, CURRENT_EXECUTABLE_SET)
@@ -84,7 +85,8 @@
raise Exception("To execute 'types' testsuite remotely, the remote sandboxed executable path needs to be defined by the infrastructure")
if not lldb.lldbtest_remote_shell_template:
raise Exception("To execute 'types' testsuite remotely, make sure you have the remote shell template defined in your config file")
- go = system(lldb.lldbtest_remote_shell_template % lldb.lldbtest_remote_sandboxed_executable, sender=self)[0]
+ go = system(shlex.split(lldb.lldbtest_remote_shell_template % lldb.lldbtest_remote_sandboxed_executable),
+ sender=self)[0]
else:
go = system("./%s" % exe_name, sender=self)[0]
# This golden list contains a list of (variable, value) pairs extracted
@@ -155,12 +157,21 @@
def generic_type_expr_tester(self, exe_name, atoms, quotedDisplay=False, blockCaptured=False):
"""Test that variable expressions with basic types are evaluated correctly."""
+ import shlex
self.runCmd("file %s" % exe_name, CURRENT_EXECUTABLE_SET)
# First, capture the golden output emitted by the oracle, i.e., the
# series of printf statements.
- go = system("./%s" % exe_name, sender=self)[0]
+ if lldb.lldbtest_remote_sandbox:
+ if not lldb.lldbtest_remote_sandboxed_executable:
+ raise Exception("To execute 'types' testsuite remotely, the remote sandboxed executable path needs to be defined by the infrastructure")
+ if not lldb.lldbtest_remote_shell_template:
+ raise Exception("To execute 'types' testsuite remotely, make sure you have the remote shell template defined in your config file")
+ go = system(shlex.split(lldb.lldbtest_remote_shell_template % lldb.lldbtest_remote_sandboxed_executable),
+ sender=self)[0]
+ else:
+ go = system("./%s" % exe_name, sender=self)[0]
# This golden list contains a list of (variable, value) pairs extracted
# from the golden output.
gl = []
More information about the lldb-commits
mailing list