From: Daniel Malea Date: Tue, 30 Jul 2013 21:34:44 +0000 (+0000) Subject: Assorted test suite fixes as a result of GCC 4.8 validation efforts X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7dadf4999a88998dc7ec192638759faca07798c0;p=platform%2Fupstream%2Fllvm.git 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)! llvm-svn: 187451 --- diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py index ae61f996..84d4e40 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py @@ -23,6 +23,8 @@ class StdVectorDataFormatterTestCase(TestBase): @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() diff --git a/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py b/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py index 81e5510..6819ebe 100644 --- a/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py +++ b/lldb/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py @@ -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()) diff --git a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py index 9dd6fda..3579f7a 100644 --- a/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py +++ b/lldb/test/lang/cpp/unique-types/TestUniqueTypes.py @@ -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) diff --git a/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py b/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py index 8d39099..ddf768e 100644 --- a/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py +++ b/lldb/test/lang/cpp/unsigned_types/TestUnsignedTypes.py @@ -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) diff --git a/lldb/test/python_api/hello_world/TestHelloWorld.py b/lldb/test/python_api/hello_world/TestHelloWorld.py index 0fcfacb..d4fabbb 100644 --- a/lldb/test/python_api/hello_world/TestHelloWorld.py +++ b/lldb/test/python_api/hello_world/TestHelloWorld.py @@ -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. diff --git a/lldb/test/settings/TestSettings.py b/lldb/test/settings/TestSettings.py index 240e4f0..09a6860 100644 --- a/lldb/test/settings/TestSettings.py +++ b/lldb/test/settings/TestSettings.py @@ -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