Skip to content

Commit 3d7e6db

Browse files
authored
[lldb][test] Remove reason from unittest2.expectedFailure usage (#73028)
1 parent 2e838c8 commit 3d7e6db

File tree

9 files changed

+22
-18
lines changed

9 files changed

+22
-18
lines changed

lldb/packages/Python/lldbsuite/test/decorators.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ def _compiler_supports(
113113
return True
114114

115115

116-
def expectedFailure(func):
117-
return unittest2.expectedFailure(func)
118-
119-
120116
def expectedFailureIfFn(expected_fn, bugnumber=None):
121117
def expectedFailure_impl(func):
122118
if isinstance(func, type) and issubclass(func, unittest2.TestCase):

lldb/test/API/commands/expression/test/TestExprs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"""
1313

1414

15+
import unittest2
1516
import lldb
1617
from lldbsuite.test.decorators import *
1718
from lldbsuite.test.lldbtest import *
@@ -43,9 +44,9 @@ def build_and_run(self):
4344

4445
self.runCmd("run", RUN_SUCCEEDED)
4546

46-
@expectedFailure(
47-
"llvm.org/pr17135 <rdar://problem/14874559> APFloat::toString does not identify the correct (i.e. least) precision."
48-
)
47+
# llvm.org/pr17135 <rdar://problem/14874559>
48+
# APFloat::toString does not identify the correct (i.e. least) precision.
49+
@unittest2.expectedFailure
4950
def test_floating_point_expr_commands(self):
5051
self.build_and_run()
5152

lldb/test/API/functionalities/jitloader_gdb/TestJITLoaderGDB.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Test for the JITLoaderGDB interface"""
22

33

4+
import unittest2
45
import os
56
import lldb
67
from lldbsuite.test import lldbutil
@@ -13,7 +14,7 @@ class JITLoaderGDBTestCase(TestBase):
1314
lambda: "Skipped because the test crashes the test runner",
1415
bugnumber="llvm.org/pr24702",
1516
)
16-
@expectedFailure("llvm.org/pr24702")
17+
@unittest2.expectedFailure # llvm.org/pr24702
1718
def test_bogus_values(self):
1819
"""Test that we handle inferior misusing the GDB JIT interface"""
1920
self.build()

lldb/test/API/functionalities/thread/state/TestThreadStates.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55

6+
import unittest2
67
import lldb
78
from lldbsuite.test.decorators import *
89
from lldbsuite.test.lldbtest import *
@@ -40,14 +41,14 @@ def test_state_after_continue(self):
4041
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24660")
4142
@expectedFailureNetBSD
4243
# thread states not properly maintained
43-
@expectedFailure("llvm.org/pr16712")
44+
@unittest2.expectedFailure # llvm.org/pr16712
4445
def test_state_after_expression(self):
4546
"""Test thread state after expression."""
4647
self.build()
4748
self.thread_state_after_expression_test()
4849

4950
# thread states not properly maintained
50-
@expectedFailure("llvm.org/pr15824 and <rdar://problem/28557237>")
51+
@unittest2.expectedFailure # llvm.org/pr15824 and <rdar://problem/28557237>
5152
@expectedFailureAll(
5253
oslist=["windows"],
5354
bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly",

lldb/test/API/lang/c/shared_lib/TestSharedLib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Test that types defined in shared libraries work correctly."""
22

33

4+
import unittest2
45
import lldb
56
from lldbsuite.test.decorators import *
67
from lldbsuite.test.lldbtest import *
@@ -34,7 +35,7 @@ def test_expr_no_preload(self):
3435
"""Test that types work when defined in a shared library and forward-declared in the main executable, but with preloading disabled"""
3536
self.common_test_expr(False)
3637

37-
@expectedFailure("llvm.org/PR36712")
38+
@unittest2.expectedFailure # llvm.org/PR36712
3839
def test_frame_variable(self):
3940
"""Test that types work when defined in a shared library and forward-declared in the main executable"""
4041
self.build()

lldb/test/API/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Test that types defined in shared libraries with stripped symbols work correctly."""
22

33

4+
import unittest2
45
import lldb
56
from lldbsuite.test.decorators import *
67
from lldbsuite.test.lldbtest import *
@@ -27,7 +28,7 @@ def test_expr(self):
2728
)
2829

2930
@expectedFailureAll(oslist=["windows"])
30-
@expectedFailure("llvm.org/PR36712")
31+
@unittest2.expectedFailure # llvm.org/PR36712
3132
def test_frame_variable(self):
3233
"""Test that types work when defined in a shared library and forward-declared in the main executable"""
3334
self.build()

lldb/test/API/lang/cpp/namespace/TestNamespaceLookup.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55

6+
import unittest2
67
import lldb
78
from lldbsuite.test.decorators import *
89
from lldbsuite.test.lldbtest import *
@@ -40,7 +41,7 @@ def runToBkpt(self, command):
4041
)
4142

4243
@skipIfWindows # This is flakey on Windows: llvm.org/pr38373
43-
@expectedFailure("CU-local objects incorrectly scoped")
44+
@unittest2.expectedFailure # CU-local objects incorrectly scoped
4445
def test_scope_lookup_with_run_command_globals(self):
4546
"""Test scope lookup of functions in lldb."""
4647
self.build()
@@ -210,7 +211,7 @@ def test_scope_lookup_with_run_command(self):
210211
# Evaluate B::func() - should call B::func()
211212
self.expect_expr("B::func()", result_type="int", result_value="4")
212213

213-
@expectedFailure("lldb scope lookup of functions bugs")
214+
@unittest2.expectedFailure # lldb scope lookup of functions bugs
214215
def test_function_scope_lookup_with_run_command(self):
215216
"""Test scope lookup of functions in lldb."""
216217
self.build()
@@ -271,7 +272,7 @@ def test_scope_after_using_directive_lookup_with_run_command(self):
271272
# Evaluate func2() - should call A::func2()
272273
self.expect_expr("func2()", result_type="int", result_value="3")
273274

274-
@expectedFailure("lldb scope lookup after using declaration bugs")
275+
@unittest2.expectedFailure # lldb scope lookup after using declaration bugs
275276
# NOTE: this test may fail on older systems that don't emit import
276277
# emtries in DWARF - may need to add checks for compiler versions here.
277278
def test_scope_after_using_declaration_lookup_with_run_command(self):
@@ -293,7 +294,7 @@ def test_scope_after_using_declaration_lookup_with_run_command(self):
293294
# Evaluate func() - should call A::func()
294295
self.expect_expr("func()", result_type="int", result_value="3")
295296

296-
@expectedFailure("lldb scope lookup ambiguity after using bugs")
297+
@unittest2.expectedFailure # lldb scope lookup ambiguity after using bugs
297298
def test_scope_ambiguity_after_using_lookup_with_run_command(self):
298299
"""Test scope lookup ambiguity after using in lldb."""
299300
self.build()

lldb/test/API/lang/cpp/reference-to-outer-type/TestCppReferenceToOuterClass.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import unittest2
12
import lldb
23
from lldbsuite.test.decorators import *
34
from lldbsuite.test.lldbtest import *
45
from lldbsuite.test import lldbutil
56

67

78
class TestCase(TestBase):
8-
@expectedFailure("The fix for this was reverted due to llvm.org/PR52257")
9+
@unittest2.expectedFailure # The fix for this was reverted due to llvm.org/PR52257
910
def test(self):
1011
self.build()
1112
self.dbg.CreateTarget(self.getBuildArtifact("a.out"))

lldb/test/API/lang/objc/hidden-ivars/TestHiddenIvars.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import subprocess
55

6+
import unittest2
67
import lldb
78
from lldbsuite.test.decorators import *
89
from lldbsuite.test.lldbtest import *
@@ -57,7 +58,7 @@ def test_frame_variable(self):
5758
self.build()
5859
self.frame_var(False)
5960

60-
@expectedFailure("rdar://18683637")
61+
@unittest2.expectedFailure # rdar://18683637
6162
def test_frame_variable_across_modules(self):
6263
if self.getArchitecture() == "i386":
6364
self.skipTest("requires modern objc runtime")

0 commit comments

Comments
 (0)