From a3cd8d76deeea89a56875f2e2aced8afba13f441 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Wed, 28 Aug 2024 14:41:32 +0000 Subject: [PATCH] [lldb][lldb-dap][test] Enable variable tests on Windows At least for our Windows on Arm machine compiling with clang-cl, it has inverted which variables get a `::` prefix. Would not surprise me if msvc does the opposite so feel free to revert if these tests fail for you. --- .../lldb-dap/variables/TestDAP_variables.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py b/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py index 3c6901b2fd99..f4f30b6677e5 100644 --- a/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py +++ b/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py @@ -200,11 +200,19 @@ class TestDAP_variables(lldbdap_testcase.DAPTestCaseBase): verify_locals["pt"]["$__lldb_extensions"] = { "equals": {"autoSummary": "{x:11, y:22}"} } + verify_globals = { "s_local": {"equals": {"type": "float", "value": "2.25"}}, - "::g_global": {"equals": {"type": "int", "value": "123"}}, - "s_global": {"equals": {"type": "int", "value": "234"}}, } + s_global = {"equals": {"type": "int", "value": "234"}} + g_global = {"equals": {"type": "int", "value": "123"}} + if lldbplatformutil.getHostPlatform() == "windows": + verify_globals["::s_global"] = s_global + verify_globals["g_global"] = g_global + else: + verify_globals["s_global"] = s_global + verify_globals["::g_global"] = g_global + varref_dict = {} self.verify_variables(verify_locals, locals, varref_dict) self.verify_variables(verify_globals, globals, varref_dict) @@ -393,13 +401,11 @@ class TestDAP_variables(lldbdap_testcase.DAPTestCaseBase): self.verify_variables(verify_locals, locals) - @skipIfWindows def test_scopes_variables_setVariable_evaluate(self): self.do_test_scopes_variables_setVariable_evaluate( enableAutoVariableSummaries=False ) - @skipIfWindows def test_scopes_variables_setVariable_evaluate_with_descriptive_summaries(self): self.do_test_scopes_variables_setVariable_evaluate( enableAutoVariableSummaries=True @@ -600,11 +606,9 @@ class TestDAP_variables(lldbdap_testcase.DAPTestCaseBase): if scope["name"] == "Registers": self.assertEqual(scope.get("presentationHint"), "registers") - @skipIfWindows def test_scopes_and_evaluate_expansion(self): self.do_test_scopes_and_evaluate_expansion(enableAutoVariableSummaries=False) - @skipIfWindows def test_scopes_and_evaluate_expansion_with_descriptive_summaries(self): self.do_test_scopes_and_evaluate_expansion(enableAutoVariableSummaries=True)