Skip to content

Commit 0e2970f

Browse files
authored
[lldb] Make libc++ simulator tests compatible with category-based ski… (#111353)
…pping, which works by setting a field on the function object. This doesn't work on a functools.partial object. Use a real function instead.
1 parent 0e8555d commit 0e2970f

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/optional/TestDataFormatterLibcxxOptionalSimulator.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def _run_test(self, defines):
4646
for r in range(2):
4747
name = f"test_r{r}"
4848
defines = [f"REVISION={r}"]
49-
f = functools.partialmethod(
50-
LibcxxOptionalDataFormatterSimulatorTestCase._run_test, defines
51-
)
52-
setattr(LibcxxOptionalDataFormatterSimulatorTestCase, name, f)
49+
50+
@functools.wraps(LibcxxOptionalDataFormatterSimulatorTestCase._run_test)
51+
def test_method(self, defines=defines):
52+
LibcxxOptionalDataFormatterSimulatorTestCase._run_test(self, defines)
53+
54+
setattr(LibcxxOptionalDataFormatterSimulatorTestCase, name, test_method)

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ def _run_test(self, defines):
3434
if v:
3535
name += "_" + v
3636
defines += [v]
37-
f = functools.partialmethod(
38-
LibcxxStringDataFormatterSimulatorTestCase._run_test, defines
39-
)
40-
setattr(LibcxxStringDataFormatterSimulatorTestCase, name, f)
37+
38+
@functools.wraps(LibcxxStringDataFormatterSimulatorTestCase._run_test)
39+
def test_method(self, defines=defines):
40+
LibcxxStringDataFormatterSimulatorTestCase._run_test(self, defines)
41+
42+
setattr(LibcxxStringDataFormatterSimulatorTestCase, name, test_method)

lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/unique_ptr/TestDataFormatterLibcxxUniquePtrSimulator.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def _run_test(self, defines):
2929
for r in range(3):
3030
name = "test_r%d" % r
3131
defines = ["COMPRESSED_PAIR_REV=%d" % r]
32-
f = functools.partialmethod(
33-
LibcxxUniquePtrDataFormatterSimulatorTestCase._run_test, defines
34-
)
35-
setattr(LibcxxUniquePtrDataFormatterSimulatorTestCase, name, f)
32+
33+
@functools.wraps(LibcxxUniquePtrDataFormatterSimulatorTestCase._run_test)
34+
def test_method(self, defines=defines):
35+
LibcxxUniquePtrDataFormatterSimulatorTestCase._run_test(self, defines)
36+
37+
setattr(LibcxxUniquePtrDataFormatterSimulatorTestCase, name, test_method)

0 commit comments

Comments
 (0)