From 4397f63f7675d09af6a2c04d5abce4dc2cbe9083 Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Thu, 18 Apr 2024 17:35:44 +0100 Subject: [PATCH] [lldb][test][redecl-completion] XFAIL currently unsupported tests w/ lazy method loading --- .../completion/TestExprCompletion.py | 1 + .../context-object/TestContextObject.py | 28 ++++++++++++++----- .../empty-module/TestEmptyStdModule.py | 1 + .../expression/pr35310/TestExprsBug35310.py | 1 + .../class_members/TestSBTypeClassMembers.py | 1 + 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/lldb/test/API/commands/expression/completion/TestExprCompletion.py b/lldb/test/API/commands/expression/completion/TestExprCompletion.py index 27a9e1d8a00f78..22327f5e006c7c 100644 --- a/lldb/test/API/commands/expression/completion/TestExprCompletion.py +++ b/lldb/test/API/commands/expression/completion/TestExprCompletion.py @@ -13,6 +13,7 @@ class CommandLineExprCompletionTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True + @expectedFailureAll(setting=('plugin.typesystem.clang.experimental-redecl-completion', 'true')) def test_expr_completion(self): self.build() self.main_source = "main.cpp" diff --git a/lldb/test/API/commands/expression/context-object/TestContextObject.py b/lldb/test/API/commands/expression/context-object/TestContextObject.py index 1ed629a42c1ee8..a9606f7b84097c 100644 --- a/lldb/test/API/commands/expression/context-object/TestContextObject.py +++ b/lldb/test/API/commands/expression/context-object/TestContextObject.py @@ -5,9 +5,29 @@ import lldb import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest import * - +from lldbsuite.test.decorators import * class ContextObjectTestCase(TestBase): + @expectedFailureAll(setting=('plugin.typesystem.clang.experimental-redecl-completion', 'true')) + def test_context_object_eval_function(self): + """Tests expression evaluation of functions in context of an object.""" + self.build() + + (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( + self, "// Break here", self.main_source_spec + ) + frame = thread.GetFrameAtIndex(0) + for obj in "cpp_struct", "cpp_struct_ref": + obj_val = frame.FindVariable(obj) + self.assertTrue(obj_val.IsValid()) + + # Test functions evaluation + value = obj_val.EvaluateExpression("function()") + self.assertTrue(value.IsValid()) + self.assertSuccess(value.GetError()) + self.assertEqual(value.GetValueAsSigned(), 2222) + + def test_context_object(self): """Tests expression evaluation in context of an object.""" self.build() @@ -35,12 +55,6 @@ def test_context_object(self): self.assertSuccess(value.GetError()) self.assertEqual(value.GetValueAsSigned(), 1111) - # Test functions evaluation - value = obj_val.EvaluateExpression("function()") - self.assertTrue(value.IsValid()) - self.assertSuccess(value.GetError()) - self.assertEqual(value.GetValueAsSigned(), 2222) - # Test that we retrieve the right global value = obj_val.EvaluateExpression("global.field") self.assertTrue(value.IsValid()) diff --git a/lldb/test/API/commands/expression/import-std-module/empty-module/TestEmptyStdModule.py b/lldb/test/API/commands/expression/import-std-module/empty-module/TestEmptyStdModule.py index 913d964578918c..22f5aa2825f7dc 100644 --- a/lldb/test/API/commands/expression/import-std-module/empty-module/TestEmptyStdModule.py +++ b/lldb/test/API/commands/expression/import-std-module/empty-module/TestEmptyStdModule.py @@ -15,6 +15,7 @@ class ImportStdModule(TestBase): @add_test_categories(["libc++"]) @skipIfRemote @skipIf(compiler=no_match("clang")) + @expectedFailureAll(setting=('plugin.typesystem.clang.experimental-redecl-completion', 'true')) def test(self): self.build() diff --git a/lldb/test/API/commands/expression/pr35310/TestExprsBug35310.py b/lldb/test/API/commands/expression/pr35310/TestExprsBug35310.py index ea609367bc5b0c..ee7429cb6be1f0 100644 --- a/lldb/test/API/commands/expression/pr35310/TestExprsBug35310.py +++ b/lldb/test/API/commands/expression/pr35310/TestExprsBug35310.py @@ -12,6 +12,7 @@ def setUp(self): self.main_source = "main.cpp" self.main_source_spec = lldb.SBFileSpec(self.main_source) + @expectedFailureAll(setting=('plugin.typesystem.clang.experimental-redecl-completion', 'true')) def test_issue35310(self): """Test invoking functions with non-standard linkage names. diff --git a/lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py b/lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py index 5ad2a073be585b..445008968a140b 100644 --- a/lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py +++ b/lldb/test/API/python_api/class_members/TestSBTypeClassMembers.py @@ -19,6 +19,7 @@ def setUp(self): self.source = "main.mm" self.line = line_number(self.source, "// set breakpoint here") + @expectedFailureAll(setting=('plugin.typesystem.clang.experimental-redecl-completion', 'true')) @skipUnlessDarwin def test(self): """Test SBType APIs to fetch member function types."""