Skip to content

Commit

Permalink
Remove expectedFailureWindows decorator.
Browse files Browse the repository at this point in the history
expectedFailureWindows is equivalent to using the general
expectedFailureAll decorator with oslist="windows".  Additionally,
by moving towards these common decorators we can solve the issue
of having to support decorators that can be called with or without
arguments.  Once all decorators are always called with arguments,
and this is enforced by design (because you can't specify the condition
you're decorating for without passing an argument) the implementation
of the decorators can become much simpler

Differential Revision: http://reviews.llvm.org/D16936

llvm-svn: 260134
  • Loading branch information
Zachary Turner committed Feb 8, 2016
1 parent 850ec6c commit 4a289a9
Showing 117 changed files with 181 additions and 193 deletions.
Original file line number Diff line number Diff line change
@@ -18,10 +18,8 @@ class TestMultipleSimultaneousDebuggers(TestBase):

@skipIfi386
@skipIfNoSBHeaders
@expectedFailureFreeBSD("llvm.org/pr20282")
@expectedFailureLinux("llvm.org/pr20282")
@expectedFailureWindows # Test crashes
@expectedFlakeyDarwin()
@expectedFailureAll(oslist=["windows", "linux", "freebsd"], bugnumber="llvm.org/pr20282")
def test_multiple_debuggers(self):
env = {self.dylibPath : self.getLLDBLibraryEnvVal()}

Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ def setUp(self):

@benchmarks_test
@no_debug_info_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_lldb_then_gdb(self):
"""Test disassembly on a large function with lldb vs. gdb."""
print()
@@ -58,7 +58,7 @@ def test_run_lldb_then_gdb(self):

@benchmarks_test
@no_debug_info_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_gdb_then_lldb(self):
"""Test disassembly on a large function with lldb vs. gdb."""
print()
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ def setUp(self):

@benchmarks_test
@no_debug_info_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_41_then_42(self):
"""Test disassembly on a large function with 4.1 vs. 4.2's gdb."""
print()
@@ -42,7 +42,7 @@ def test_run_41_then_42(self):

@benchmarks_test
@no_debug_info_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_42_then_41(self):
"""Test disassembly on a large function with 4.1 vs. 4.2's gdb."""
print()
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ def setUp(self):
self.count = 25

@benchmarks_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_expr_cmd(self):
"""Test lldb's expression commands and collect statistics."""
self.build()
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ def setUp(self):
self.count = 100

@benchmarks_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_compare_lldb_to_gdb(self):
"""Test repeated expressions with lldb vs. gdb."""
self.build()
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ def setUp(self):

@benchmarks_test
@no_debug_info_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_startup_delay(self):
"""Test response time for the 'frame variable' command."""
print()
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ def setUp(self):

@benchmarks_test
@no_debug_info_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_startup_delay(self):
"""Test start up delays creating a target, setting a breakpoint, and run to breakpoint stop."""
print()
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ def setUp(self):

@benchmarks_test
@no_debug_info_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_lldb_steppings(self):
"""Test lldb steppings on a large executable."""
print()
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ def setUp(self):

@benchmarks_test
@no_debug_info_test
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_run_lldb_then_gdb(self):
"""Benchmark turnaround time with lldb vs. gdb."""
print()
5 changes: 2 additions & 3 deletions lldb/packages/Python/lldbsuite/test/decorators.py
Original file line number Diff line number Diff line change
@@ -167,6 +167,8 @@ def fn(self):
reason_str = "{} due to the following parameter(s): {}".format(mode_str, reason_str)
else:
reason_str = "{} unconditionally"
if bugnumber is not None and not six.callable(bugnumber):
reason_str = reason_str + " [" + str(bugnumber) + "]"
return reason_str

if mode == DecorateMode.Skip:
@@ -348,9 +350,6 @@ def expectedFailureLinux(bugnumber=None, compilers=None, debug_info=None, archs=
def expectedFailureNetBSD(bugnumber=None, compilers=None, debug_info=None):
return expectedFailureOS(['netbsd'], bugnumber, compilers, debug_info=debug_info)

def expectedFailureWindows(bugnumber=None, compilers=None, debug_info=None):
return expectedFailureOS(['windows'], bugnumber, compilers, debug_info=debug_info)

def expectedFailureHostWindows(bugnumber=None, compilers=None):
return expectedFailureHostOS(['windows'], bugnumber, compilers)

Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ def expect_string (self, string):
@skipIfRemote # test not remote-ready llvm.org/pr24813
@expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot")
@expectedFlakeyLinux("llvm.org/pr25172")
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_batch_mode_run_crash (self):
"""Test that the lldb driver's batch mode works correctly."""
self.build()
@@ -73,7 +73,7 @@ def test_batch_mode_run_crash (self):
@skipIfRemote # test not remote-ready llvm.org/pr24813
@expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot")
@expectedFlakeyLinux("llvm.org/pr25172")
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_batch_mode_run_exit (self):
"""Test that the lldb driver's batch mode works correctly."""
self.build()
@@ -110,7 +110,7 @@ def closeVictim(self):
@skipIfRemote # test not remote-ready llvm.org/pr24813
@expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot")
@expectedFlakeyLinux("llvm.org/pr25172")
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
def test_batch_mode_attach_exit (self):
"""Test that the lldb driver's batch mode works correctly."""
self.build()
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ def setUp(self):

@expectedFailureIcc # llvm.org/pr14437, fails with ICC 13.1
@expectedFailureFreeBSD('llvm.org/pr17807') # Fails on FreeBSD buildbot
@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_with(self):
"""Test calling std::String member function."""
self.build()
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ def setUp(self):
'{ 5, "five" }')

@expectedFlakeyDarwin("llvm.org/pr20274")
@expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
def test(self):
"""Test gathering result from interrupted function call."""
self.build()
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ def setUp(self):
self.line = line_number('main.cpp',
'// Please test these expressions while stopped at this line:')
@expectedFlakeyDsym("llvm.org/pr20274")
@expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
def test(self):
"""Test return values of user defined function calls."""
self.build()
Original file line number Diff line number Diff line change
@@ -53,19 +53,19 @@ def do_test(self, dictionary=None):
self.assertTrue(value.GetError().Success())
self.assertEqual(value.GetValueAsSigned(0), 3)

@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_default_char(self):
self.do_test()

@expectedFailureArch("arm", "llvm.org/pr23069")
@expectedFailureArch("aarch64", "llvm.org/pr23069")
@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_signed_char(self):
self.do_test(dictionary={'CFLAGS_EXTRAS': '-fsigned-char'})

@expectedFailurei386("llvm.org/pr23069")
@expectedFailurex86_64("llvm.org/pr23069")
@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
@expectedFailureAll(bugnumber="llvm.org/pr23069", triple = 'mips*')
def test_unsigned_char(self):
self.do_test(dictionary={'CFLAGS_EXTRAS': '-funsigned-char'})
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ class ExprSyscallTestCase(TestBase):

mydir = TestBase.compute_mydir(__file__)

@expectedFailureWindows("llvm.org/pr21765") # Also getpid() is not a function on Windows anyway
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765, getpid() does not exist on Windows")
def test_setpgid(self):
self.build()
self.expr_syscall()
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ def setUp(self):
@skipIfFreeBSD # llvm.org/pr24691 skipping to avoid crashing the test runner
@expectedFailureFreeBSD('llvm.org/pr19011') # Newer Clang omits C1 complete object constructor
@expectedFailureFreeBSD('llvm.org/pr24691') # we hit an assertion in clang
@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
@skipIfTargetAndroid() # skipping to avoid crashing the test runner
@expectedFailureAndroid('llvm.org/pr24691') # we hit an assertion in clang
def test(self):
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ class Issue11581TestCase(TestBase):

mydir = TestBase.compute_mydir(__file__)

@expectedFailureWindows("llvm.org/pr24778")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_11581_commands(self):
# This is the function to remove the custom commands in order to have a
# clean slate for the next test case.
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ class NestedPersistentTypesTestCase(TestBase):

mydir = TestBase.compute_mydir(__file__)

@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_persistent_types(self):
"""Test that nested persistent types work."""
self.build()
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ class PersistenttypesTestCase(TestBase):

mydir = TestBase.compute_mydir(__file__)

@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_persistent_types(self):
"""Test that lldb persistent types works correctly."""
self.build()
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ class Radar9531204TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)

# rdar://problem/9531204
@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_expr_commands(self):
"""The evaluating printf(...) after break stop and then up a stack frame."""
self.build()
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ def setUp(self):
self.main_source = "main.c"
self.line = line_number(self.main_source, '// Set breakpoint here.')

@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_expr_commands(self):
"""The following expression commands should just work."""
self.build()
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ def test_floating_point_expr_commands(self):
patterns = ["\(float\) \$.* = 2\.234"])
# (float) $2 = 2.234

@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_many_expr_commands(self):
self.build_and_run()

@@ -99,7 +99,7 @@ def test_many_expr_commands(self):
# (const char *) $8 = 0x... "/Volumes/data/lldb/svn/trunk/test/expression_command/test/a.out"

@add_test_categories(['pyapi'])
@expectedFailureWindows # Test crashes
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_evaluate_expression_python(self):
"""Test SBFrame.EvaluateExpression() API for evaluating an expression."""
self.build()
@@ -195,7 +195,7 @@ def test_evaluate_expression_python(self):

# rdar://problem/8686536
# CommandInterpreter::HandleCommand is stripping \'s from input for WantsRawCommand commands
@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test_expr_commands_can_handle_quotes(self):
"""Throw some expression commands with quotes at lldb."""
self.build()
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ def setUp(self):
self.line = line_number('main.cpp',
'// Please test many expressions while stopped at this line:')

@expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
def test_more_expr_commands(self):
"""Test some more expression commands."""
self.build()
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ def setUp(self):


@expectedFlakeyFreeBSD("llvm.org/pr19605")
@expectedFailureWindows("llvm.org/pr21765")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
def test(self):
"""Test calling std::String member function."""
self.build()
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ def setUp(self):
# Find the line number in a(int) to break at.
self.line = line_number('a.c', '// Set file and line breakpoint inside a().')

@expectedFailureWindows("llvm.org/pr24527") # Makefile.rules doesn't know how to build static libs on Windows.
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24527. Makefile.rules doesn't know how to build static libs on Windows")
def test(self):
"""Break inside a() and b() defined within libfoo.a."""
self.build()
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ class AttachResumeTestCase(TestBase):

@skipIfRemote
@expectedFailureFreeBSD('llvm.org/pr19310')
@expectedFailureWindows("llvm.org/pr24778")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_attach_continue_interrupt_detach(self):
"""Test attach/continue/interrupt/detach"""
self.build()
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ def classCleanup(cls):
cls.RemoveTempFile("output.txt")
cls.RemoveTempFile("output2.txt")

@expectedFailureWindows("llvm.org/pr24528")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
def test(self):
"""Test a sequence of breakpoint command add, list, and delete."""
self.build()
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ class BreakpointLocationsTestCase(TestBase):

mydir = TestBase.compute_mydir(__file__)

@expectedFailureWindows("llvm.org/pr24528")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
@expectedFailureAll(oslist=["linux"], compiler="clang", compiler_version=[">=", "3.8"], archs=["i386"], debug_info="dwo")
def test(self):
"""Test breakpoint enable/disable for a breakpoint ID with multiple locations."""
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ class TestCPPBreakpointLocations(TestBase):

mydir = TestBase.compute_mydir(__file__)

@expectedFailureWindows("llvm.org/pr24764")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
def test (self):
self.build ()
self.breakpoint_id_tests ()
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ class TestCPPExceptionBreakpoint (TestBase):
my_var = 10

@add_test_categories(['pyapi'])
@expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24538")
def test_cpp_exception_breakpoint(self):
"""Test setting and hitting the C++ exception breakpoint."""
self.build()
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ def setUp(self):
PExpectTest.setUp(self)

@skipIfRemote # test not remote-ready llvm.org/pr24813
@expectedFailureWindows("llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
@expectedFailureLinux("llvm.org/pr26139")
def test_command_script_immediate_output (self):
"""Test that LLDB correctly allows scripted commands to set an immediate output file."""
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ def test_with_command(self):
self.build()
self.simulate_conditional_break_by_user()

@expectedFailureWindows("llvm.org/pr26265") # args in frames other than #0 are not evaluated correctly
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr26265: args in frames other than #0 are not evaluated correctly")
def do_conditional_break(self):
"""Exercise some thread and frame APIs to break if c() is called by a()."""
exe = os.path.join(os.getcwd(), "a.out")
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ def setUp(self):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')

@expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462: Data formatters have problems on Windows")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ def setUp(self):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')

@expectedFailureWindows("llvm.org/pr24462") # Data formatters have problems on Windows
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24462, Data formatters have problems on Windows")
def test_with_run_command(self):
"""Check that we can properly disable all data formatter categories."""
self.build()
Loading

0 comments on commit 4a289a9

Please sign in to comment.