Skip to content

Commit

Permalink
[lldb][lldb-dap][test] Enable variable tests on Windows
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DavidSpickett committed Aug 28, 2024
1 parent fee4836 commit a3cd8d7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,19 @@ def do_test_scopes_variables_setVariable_evaluate(
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)
Expand Down Expand Up @@ -393,13 +401,11 @@ def do_test_scopes_variables_setVariable_evaluate(

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
Expand Down Expand Up @@ -600,11 +606,9 @@ def do_test_scopes_and_evaluate_expansion(self, enableAutoVariableSummaries: boo
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)

Expand Down

0 comments on commit a3cd8d7

Please sign in to comment.