[Lldb-commits] [lldb] r176972 - Minor LLDB test improvements

Daniel Malea daniel.malea at intel.com
Wed Mar 13 13:50:06 PDT 2013


Author: dmalea
Date: Wed Mar 13 15:50:05 2013
New Revision: 176972

URL: http://llvm.org/viewvc/llvm-project?rev=176972&view=rev
Log:
Minor LLDB test improvements
- fix TestCPPBool (was failing with some versions of GCC due to num_breakpoint_locations)
- speed up tests by skipping git/svn revision parsing by the test harness when running in lit-compatible (parsable) mode

This should resolve the failures reported by http://lab.llvm.org:8011/builders/lldb-x86_64-linux


Modified:
    lldb/trunk/test/dotest.py
    lldb/trunk/test/lang/cpp/bool/TestCPPBool.py

Modified: lldb/trunk/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=176972&r1=176971&r2=176972&view=diff
==============================================================================
--- lldb/trunk/test/dotest.py (original)
+++ lldb/trunk/test/dotest.py Wed Mar 13 15:50:05 2013
@@ -832,14 +832,16 @@ def setupSysPath():
         os.environ["LLDB_EXEC"] = lldbExec
         #print "The 'lldb' from PATH env variable", lldbExec
 
-    if os.path.isdir(os.path.join(base, '.svn')) and which("svn") is not None:
-        pipe = subprocess.Popen([which("svn"), "info", base], stdout = subprocess.PIPE)
-        svn_info = pipe.stdout.read()
-    elif os.path.isdir(os.path.join(base, '.git')) and which("git") is not None:
-        pipe = subprocess.Popen([which("git"), "svn", "info", base], stdout = subprocess.PIPE)
-        svn_info = pipe.stdout.read()
-    if not noHeaders:
-        print svn_info
+    # Skip printing svn/git information when running in parsable (lit-test compatibility) mode
+    if not parsable:
+        if os.path.isdir(os.path.join(base, '.svn')) and which("svn") is not None:
+            pipe = subprocess.Popen([which("svn"), "info", base], stdout = subprocess.PIPE)
+            svn_info = pipe.stdout.read()
+        elif os.path.isdir(os.path.join(base, '.git')) and which("git") is not None:
+            pipe = subprocess.Popen([which("git"), "svn", "info", base], stdout = subprocess.PIPE)
+            svn_info = pipe.stdout.read()
+        if not noHeaders:
+            print svn_info
 
     global ignore
 

Modified: lldb/trunk/test/lang/cpp/bool/TestCPPBool.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/bool/TestCPPBool.py?rev=176972&r1=176971&r2=176972&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/bool/TestCPPBool.py (original)
+++ lldb/trunk/test/lang/cpp/bool/TestCPPBool.py Wed Mar 13 15:50:05 2013
@@ -26,8 +26,9 @@ class CPPBoolTestCase(TestBase):
         TestBase.setUp(self)
     
     def set_breakpoint(self, line):
-        locs = 4 if "gcc" in self.getCompiler() else 1
-        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=locs, loc_exact=False)
+        # Some compilers (for example GCC 4.4.7 and 4.6.1) emit multiple locations for the statement with the ternary
+        # operator in the test program, while others emit only 1.
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", line, num_expected_locations=-1, loc_exact=False)
 
     def static_method_commands(self):
         """Test that bool types work in the expression parser"""





More information about the lldb-commits mailing list