[Lldb-commits] [lldb] 0e2970f - [lldb] Make libc++ simulator tests compatible with category-based ski… (#111353)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Oct 7 07:53:33 PDT 2024
Author: Pavel Labath
Date: 2024-10-07T16:53:26+02:00
New Revision: 0e2970f0ad723a3b4e56d18858f4fd215415002f
URL: https://github.com/llvm/llvm-project/commit/0e2970f0ad723a3b4e56d18858f4fd215415002f
DIFF: https://github.com/llvm/llvm-project/commit/0e2970f0ad723a3b4e56d18858f4fd215415002f.diff
LOG: [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.
Added:
Modified:
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/optional/TestDataFormatterLibcxxOptionalSimulator.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/unique_ptr/TestDataFormatterLibcxxUniquePtrSimulator.py
Removed:
################################################################################
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/optional/TestDataFormatterLibcxxOptionalSimulator.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/optional/TestDataFormatterLibcxxOptionalSimulator.py
index 20822c4deada0f..7167f4c6c9b5b1 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/optional/TestDataFormatterLibcxxOptionalSimulator.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/optional/TestDataFormatterLibcxxOptionalSimulator.py
@@ -46,7 +46,9 @@ def _run_test(self, defines):
for r in range(2):
name = f"test_r{r}"
defines = [f"REVISION={r}"]
- f = functools.partialmethod(
- LibcxxOptionalDataFormatterSimulatorTestCase._run_test, defines
- )
- setattr(LibcxxOptionalDataFormatterSimulatorTestCase, name, f)
+
+ @functools.wraps(LibcxxOptionalDataFormatterSimulatorTestCase._run_test)
+ def test_method(self, defines=defines):
+ LibcxxOptionalDataFormatterSimulatorTestCase._run_test(self, defines)
+
+ setattr(LibcxxOptionalDataFormatterSimulatorTestCase, name, test_method)
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
index fff181440b6d7c..c996fff4fb7aab 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/string/TestDataFormatterLibcxxStringSimulator.py
@@ -34,7 +34,9 @@ def _run_test(self, defines):
if v:
name += "_" + v
defines += [v]
- f = functools.partialmethod(
- LibcxxStringDataFormatterSimulatorTestCase._run_test, defines
- )
- setattr(LibcxxStringDataFormatterSimulatorTestCase, name, f)
+
+ @functools.wraps(LibcxxStringDataFormatterSimulatorTestCase._run_test)
+ def test_method(self, defines=defines):
+ LibcxxStringDataFormatterSimulatorTestCase._run_test(self, defines)
+
+ setattr(LibcxxStringDataFormatterSimulatorTestCase, name, test_method)
diff --git a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/unique_ptr/TestDataFormatterLibcxxUniquePtrSimulator.py b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/unique_ptr/TestDataFormatterLibcxxUniquePtrSimulator.py
index 0026eca8eebeae..4ee97e10de84cd 100644
--- a/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/unique_ptr/TestDataFormatterLibcxxUniquePtrSimulator.py
+++ b/lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx-simulators/unique_ptr/TestDataFormatterLibcxxUniquePtrSimulator.py
@@ -29,7 +29,9 @@ def _run_test(self, defines):
for r in range(3):
name = "test_r%d" % r
defines = ["COMPRESSED_PAIR_REV=%d" % r]
- f = functools.partialmethod(
- LibcxxUniquePtrDataFormatterSimulatorTestCase._run_test, defines
- )
- setattr(LibcxxUniquePtrDataFormatterSimulatorTestCase, name, f)
+
+ @functools.wraps(LibcxxUniquePtrDataFormatterSimulatorTestCase._run_test)
+ def test_method(self, defines=defines):
+ LibcxxUniquePtrDataFormatterSimulatorTestCase._run_test(self, defines)
+
+ setattr(LibcxxUniquePtrDataFormatterSimulatorTestCase, name, test_method)
More information about the lldb-commits
mailing list