[Lldb-commits] [lldb] r141384 - in /lldb/trunk/test: benchmarks/disassembly/TestDisassembly.py benchmarks/disassembly/TestFlintVsSlateGDBDisassembly.py benchmarks/example/TestRepeatedExprs.py functionalities/command_regex/TestCommandRegex.py functionalities/embedded_interpreter/TestConvenienceVariables.py functionalities/stop-hook/TestStopHookMechanism.py functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py lldbtest.py

Johnny Chen johnny.chen at apple.com
Fri Oct 7 12:21:09 PDT 2011


Author: johnny
Date: Fri Oct  7 14:21:09 2011
New Revision: 141384

URL: http://llvm.org/viewvc/llvm-project?rev=141384&view=rev
Log:
If we spawn an lldb process for test (via pexpect), do not load the init file unless told otherwise.
Set up self.lldbOption to be "--no-lldbibit" unless env variable NO_LLDBIBIT is defined and equals "NO".
Also add "-nx" to gdb spawned.

Modified:
    lldb/trunk/test/benchmarks/disassembly/TestDisassembly.py
    lldb/trunk/test/benchmarks/disassembly/TestFlintVsSlateGDBDisassembly.py
    lldb/trunk/test/benchmarks/example/TestRepeatedExprs.py
    lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py
    lldb/trunk/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
    lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py
    lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
    lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/test/benchmarks/disassembly/TestDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/benchmarks/disassembly/TestDisassembly.py?rev=141384&r1=141383&r2=141384&view=diff
==============================================================================
--- lldb/trunk/test/benchmarks/disassembly/TestDisassembly.py (original)
+++ lldb/trunk/test/benchmarks/disassembly/TestDisassembly.py Fri Oct  7 14:21:09 2011
@@ -43,7 +43,7 @@
         prompt = self.child_prompt
 
         # So that the child gets torn down after the test.
-        self.child = pexpect.spawn('%s %s' % (self.lldbExec, exe))
+        self.child = pexpect.spawn('%s %s %s' % (self.lldbExec, self.lldbOption, exe))
         child = self.child
 
         # Turn on logging for what the child sends back.
@@ -83,7 +83,7 @@
         prompt = self.child_prompt
 
         # So that the child gets torn down after the test.
-        self.child = pexpect.spawn('gdb %s' % exe)
+        self.child = pexpect.spawn('gdb --nx %s' % exe)
         child = self.child
 
         # Turn on logging for what the child sends back.

Modified: lldb/trunk/test/benchmarks/disassembly/TestFlintVsSlateGDBDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/benchmarks/disassembly/TestFlintVsSlateGDBDisassembly.py?rev=141384&r1=141383&r2=141384&view=diff
==============================================================================
--- lldb/trunk/test/benchmarks/disassembly/TestFlintVsSlateGDBDisassembly.py (original)
+++ lldb/trunk/test/benchmarks/disassembly/TestFlintVsSlateGDBDisassembly.py Fri Oct  7 14:21:09 2011
@@ -49,7 +49,7 @@
         prompt = self.child_prompt
 
         # So that the child gets torn down after the test.
-        self.child = pexpect.spawn('%s %s' % (gdb_exe_path, exe))
+        self.child = pexpect.spawn('%s --nx %s' % (gdb_exe_path, exe))
         child = self.child
 
         # Turn on logging for what the child sends back.

Modified: lldb/trunk/test/benchmarks/example/TestRepeatedExprs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/benchmarks/example/TestRepeatedExprs.py?rev=141384&r1=141383&r2=141384&view=diff
==============================================================================
--- lldb/trunk/test/benchmarks/example/TestRepeatedExprs.py (original)
+++ lldb/trunk/test/benchmarks/example/TestRepeatedExprs.py Fri Oct  7 14:21:09 2011
@@ -38,7 +38,7 @@
         prompt = self.child_prompt
 
         # So that the child gets torn down after the test.
-        self.child = pexpect.spawn('%s %s' % (self.lldbExec, exe))
+        self.child = pexpect.spawn('%s %s %s' % (self.lldbExec, self.lldbOption, exe))
         child = self.child
 
         # Turn on logging for what the child sends back.
@@ -83,7 +83,7 @@
         prompt = self.child_prompt
 
         # So that the child gets torn down after the test.
-        self.child = pexpect.spawn('gdb %s' % exe)
+        self.child = pexpect.spawn('gdb --nx %s' % exe)
         child = self.child
 
         # Turn on logging for what the child sends back.

Modified: lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py?rev=141384&r1=141383&r2=141384&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py (original)
+++ lldb/trunk/test/functionalities/command_regex/TestCommandRegex.py Fri Oct  7 14:21:09 2011
@@ -18,7 +18,7 @@
         regex_prompt = "Enter regular expressions in the form 's/<regex>/<subst>/' and terminate with an empty line:\r\n"
         regex_prompt1 = "\r\n"
 
-        child = pexpect.spawn('%s' % self.lldbHere)
+        child = pexpect.spawn('%s %s' % (self.lldbHere, self.lldbOption))
         # Turn on logging for what the child sends back.
         if self.TraceOn():
             child.logfile_read = sys.stdout

Modified: lldb/trunk/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/embedded_interpreter/TestConvenienceVariables.py?rev=141384&r1=141383&r2=141384&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/embedded_interpreter/TestConvenienceVariables.py (original)
+++ lldb/trunk/test/functionalities/embedded_interpreter/TestConvenienceVariables.py Fri Oct  7 14:21:09 2011
@@ -34,7 +34,7 @@
         python_prompt = ">>> "
 
         # So that the child gets torn down after the test.
-        self.child = pexpect.spawn('%s %s' % (self.lldbHere, exe))
+        self.child = pexpect.spawn('%s %s %s' % (self.lldbHere, self.lldbOption, exe))
         child = self.child
         # Turn on logging for what the child sends back.
         if self.TraceOn():

Modified: lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py?rev=141384&r1=141383&r2=141384&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py (original)
+++ lldb/trunk/test/functionalities/stop-hook/TestStopHookMechanism.py Fri Oct  7 14:21:09 2011
@@ -40,7 +40,7 @@
         add_prompt1 = "\r\n> "
 
         # So that the child gets torn down after the test.
-        self.child = pexpect.spawn('%s %s' % (self.lldbHere, exe))
+        self.child = pexpect.spawn('%s %s %s' % (self.lldbHere, self.lldbOption, exe))
         child = self.child
         # Turn on logging for what the child sends back.
         if self.TraceOn():

Modified: lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py?rev=141384&r1=141383&r2=141384&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py (original)
+++ lldb/trunk/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py Fri Oct  7 14:21:09 2011
@@ -43,7 +43,7 @@
         prompt = "(lldb) "
 
         # So that the child gets torn down after the test.
-        self.child = pexpect.spawn('%s %s' % (self.lldbHere, exe))
+        self.child = pexpect.spawn('%s %s %s' % (self.lldbHere, self.lldbOption, exe))
         child = self.child
         # Turn on logging for what the child sends back.
         if self.TraceOn():

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=141384&r1=141383&r2=141384&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Fri Oct  7 14:21:09 2011
@@ -484,6 +484,12 @@
             self.lldbHere = os.environ["LLDB_HERE"]
         else:
             self.lldbHere = None
+        # If we spawn an lldb process for test (via pexpect), do not load the
+        # init file unless told otherwise.
+        if "NO_LLDBINIT" in os.environ and "NO" == os.environ["NO_LLDBINIT"]:
+            self.lldbOption = ""
+        else:
+            self.lldbOption = "--no-lldbinit"
 
         # Assign the test method name to self.testMethodName.
         #





More information about the lldb-commits mailing list