[Lldb-commits] [lldb] r187451 - Assorted test suite fixes as a result of GCC 4.8 validation efforts

Daniel Malea daniel.malea at intel.com
Tue Jul 30 14:34:45 PDT 2013


Author: dmalea
Date: Tue Jul 30 16:34:44 2013
New Revision: 187451

URL: http://llvm.org/viewvc/llvm-project?rev=187451&view=rev
Log:
Assorted test suite fixes as a result of GCC 4.8 validation efforts
- disable some TestConcurrentEvents cases (which are affected by llvm.org/pr16714 -- watchpoints in multithreaded programs)
- relax number-of-bp-locations check in TestUniqueTypes/TestUnsignedTypes
- skip TestDataFormatterStdVector cases with GCC 4.8 (known failure due to llvm.org/pr15301)
- workaround for race condition in TestHelloWorld.py
- update TestSettings.py to work on distros (like Fedora) that have /bin/cat hardlinked to /usr/bin/cat

After these changes, the test suite should run cleanly against GCC 4.8 (with DWARF v4)!


Modified:
    lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
    lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
    lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py
    lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
    lldb/trunk/test/python_api/hello_world/TestHelloWorld.py
    lldb/trunk/test/settings/TestSettings.py

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py?rev=187451&r1=187450&r2=187451&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py Tue Jul 30 16:34:44 2013
@@ -23,6 +23,8 @@ class StdVectorDataFormatterTestCase(Tes
     @expectedFailureClang # llvm.org/pr15301 LLDB prints incorrect sizes of STL containers
     def test_with_dwarf_and_run_command(self):
         """Test data formatter commands."""
+        if "gcc" in self.getCompiler() and "4.8" in self.getCompilerVersion():
+            self.skipTest("llvm.org/pr15301 LLDB prints incorrect sizes of STL containers")
         self.buildDwarf()
         self.data_formatter_commands()
 

Modified: lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py?rev=187451&r1=187450&r2=187451&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py (original)
+++ lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py Tue Jul 30 16:34:44 2013
@@ -37,6 +37,7 @@ class ConcurrentEventsTestCase(TestBase)
         self.buildDwarf(dictionary=self.getBuildFlags())
         self.do_thread_actions(num_breakpoint_threads=100)
 
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     @unittest2.skipIf(TestBase.skipLongRunningTest(), "Skip this long running test")
     @dwarf_test
     def test_many_watchpoints_dwarf(self):
@@ -88,6 +89,7 @@ class ConcurrentEventsTestCase(TestBase)
     ## Tests for concurrent watchpoint and breakpoint
     #
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_watch_break_dwarf(self):
         """Test watchpoint and a breakpoint in multiple threads."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -95,6 +97,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_delay_watch_break_dwarf(self):
         """Test (1-second delay) watchpoint and a breakpoint in multiple threads."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -102,6 +105,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_watch_break_dwarf(self):
         """Test watchpoint and a (1 second delay) breakpoint in multiple threads."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -112,6 +116,7 @@ class ConcurrentEventsTestCase(TestBase)
     #
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_signal_watch_dwarf(self):
         """Test a watchpoint and a signal in multiple threads."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -119,6 +124,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_delay_signal_watch_dwarf(self):
         """Test a watchpoint and a (1 second delay) signal in multiple threads."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -126,6 +132,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_signal_delay_watch_dwarf(self):
         """Test a (1 second delay) watchpoint and a signal in multiple threads."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -175,6 +182,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_two_breakpoints_one_watchpoint_dwarf(self):
         """Test two threads that trigger a breakpoint and one watchpoint thread. """
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -182,6 +190,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_breakpoints_delayed_breakpoint_one_watchpoint_dwarf(self):
         """Test a breakpoint, a delayed breakpoint, and one watchpoint thread. """
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -194,6 +203,7 @@ class ConcurrentEventsTestCase(TestBase)
     #
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_two_watchpoint_threads_dwarf(self):
         """Test two threads that trigger a watchpoint. """
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -201,6 +211,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_watchpoint_with_delay_waychpoint_threads_dwarf(self):
         """Test two threads that trigger a watchpoint where one thread has a 1 second delay. """
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -209,6 +220,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_two_watchpoints_one_breakpoint_dwarf(self):
         """Test two threads that trigger a watchpoint and one breakpoint thread. """
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -216,6 +228,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_two_watchpoints_one_delay_breakpoint_dwarf(self):
         """Test two threads that trigger a watchpoint and one (1 second delay) breakpoint thread. """
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -223,6 +236,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_watchpoint_delay_watchpoint_one_breakpoint_dwarf(self):
         """Test two threads that trigger a watchpoint (one with a 1 second delay) and one breakpoint thread. """
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -232,6 +246,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_two_watchpoints_one_signal_dwarf(self):
         """Test two threads that trigger a watchpoint and one signal thread. """
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -241,6 +256,7 @@ class ConcurrentEventsTestCase(TestBase)
     ## Test for watchpoint, signal and breakpoint happening concurrently
     #
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_signal_watch_break_dwarf(self):
         """Test a signal/watchpoint/breakpoint in multiple threads."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -249,6 +265,7 @@ class ConcurrentEventsTestCase(TestBase)
                                num_breakpoint_threads=1)
 
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_signal_watch_break_dwarf(self):
         """Test one signal thread with 5 watchpoint and breakpoint threads."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -258,6 +275,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_signal_watch_break_dwarf(self):
         """Test with 5 watchpoint and breakpoint threads."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -277,6 +295,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_crash_with_watchpoint_dwarf(self):
         """ Test a thread that crashes while another thread hits a watchpoint."""
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -291,6 +310,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_crash_with_watchpoint_breakpoint_signal_dwarf(self):
         """ Test a thread that crashes while other threads generate a signal and hit a watchpoint and breakpoint. """
         self.buildDwarf(dictionary=self.getBuildFlags())
@@ -301,6 +321,7 @@ class ConcurrentEventsTestCase(TestBase)
 
     @expectedFailureFreeBSD('llvm.org/pr16706') # Watchpoints fail on FreeBSD
     @dwarf_test
+    @skipIfLinux # llvm.org/pr16714 - LLDB sometimes crashes when setting watchpoints in multithreaded programs
     def test_delayed_crash_with_breakpoint_watchpoint_dwarf(self):
         """ Test a thread with a delayed crash while other threads hit a watchpoint and a breakpoint. """
         self.buildDwarf(dictionary=self.getBuildFlags())

Modified: lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py?rev=187451&r1=187450&r2=187451&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py (original)
+++ lldb/trunk/test/lang/cpp/unique-types/TestUniqueTypes.py Tue Jul 30 16:34:44 2013
@@ -41,10 +41,7 @@ class UniqueTypesTestCase(TestBase):
 
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
-        # GCC 4.6.3 (but not 4.4, 4.6.5 or 4.7) encodes two locations for the 'return 0' statement in main.cpp
-        locs = 2 if "gcc" in compiler_basename and "4.6.3" in self.getCompilerVersion() else 1
-        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=locs, loc_exact=True)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py?rev=187451&r1=187450&r2=187451&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py (original)
+++ lldb/trunk/test/lang/cpp/unsigned_types/TestUnsignedTypes.py Tue Jul 30 16:34:44 2013
@@ -41,7 +41,7 @@ class UnsignedTypesTestCase(TestBase):
         # if GCC is the target compiler, we cannot rely on an exact line match.
         need_exact = "gcc" not in self.getCompiler()
         # Break on line 19 in main() aftre the variables are assigned values.
-        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=need_exact)
+        lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=need_exact)
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/trunk/test/python_api/hello_world/TestHelloWorld.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/hello_world/TestHelloWorld.py?rev=187451&r1=187450&r2=187451&view=diff
==============================================================================
--- lldb/trunk/test/python_api/hello_world/TestHelloWorld.py (original)
+++ lldb/trunk/test/python_api/hello_world/TestHelloWorld.py Tue Jul 30 16:34:44 2013
@@ -3,6 +3,7 @@
 import os, sys, time
 import unittest2
 import lldb
+import time
 from lldbtest import *
 
 class HelloWorldTestCase(TestBase):
@@ -139,6 +140,9 @@ class HelloWorldTestCase(TestBase):
         popen = self.spawnSubprocess(self.exe, ["abc", "xyz"])
         self.addTearDownHook(self.cleanupSubprocesses)
 
+        # Give the subprocess time to start and wait for user input
+        time.sleep(0.25)
+
         listener = lldb.SBListener("my.attach.listener")
         error = lldb.SBError()
         process = target.AttachToProcessWithID(listener, popen.pid, error)
@@ -161,6 +165,9 @@ class HelloWorldTestCase(TestBase):
         popen = self.spawnSubprocess(self.exe, ["abc", "xyz"])
         self.addTearDownHook(self.cleanupSubprocesses)
 
+        # Give the subprocess time to start and wait for user input
+        time.sleep(0.25)
+
         listener = lldb.SBListener("my.attach.listener")
         error = lldb.SBError()
         # Pass 'False' since we don't want to wait for new instance of "hello_world" to be launched.

Modified: lldb/trunk/test/settings/TestSettings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/settings/TestSettings.py?rev=187451&r1=187450&r2=187451&view=diff
==============================================================================
--- lldb/trunk/test/settings/TestSettings.py (original)
+++ lldb/trunk/test/settings/TestSettings.py Tue Jul 30 16:34:44 2013
@@ -332,7 +332,7 @@ class SettingsCommandTestCase(TestBase):
         self.runCmd ("settings set target.output-path /bin/ls")   # Set to known value
         self.runCmd ("settings set target.output-path /bin/cat ") # Set to new value with trailing whitespaces
         self.expect ("settings show target.output-path", SETTING_MSG("target.output-path"),
-            startstr = 'target.output-path (file) = "/bin/cat"')
+            startstr = 'target.output-path (file) = ', substrs=['/bin/cat"'])
         self.runCmd("settings clear target.output-path", check=False)
         # enum
         self.runCmd ("settings set stop-disassembly-display never")   # Set to known value





More information about the lldb-commits mailing list