Skip to content

Commit d579a1a

Browse files
authored
[lldb[test] TestCppUnionStaticMembers.py: XFAIL assertions on windows (#68408)
Split out the assertions that fail on Windows in preparation to XFAILing them. Drive-by change: * Add a missing `self.build()` call in `test_union_in_anon_namespace` * Fix formatting * Add expectedFailureWindows decorator
1 parent f1b2dd2 commit d579a1a

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

lldb/packages/Python/lldbsuite/test/decorators.py

+4
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,10 @@ def expectedFailureNetBSD(bugnumber=None):
511511
return expectedFailureOS(["netbsd"], bugnumber)
512512

513513

514+
def expectedFailureWindows(bugnumber=None):
515+
return expectedFailureOS(["windows"], bugnumber)
516+
517+
514518
# TODO: This decorator does not do anything. Remove it.
515519
def expectedFlakey(expected_fn, bugnumber=None):
516520
def expectedFailure_impl(func):

lldb/test/API/lang/cpp/union-static-data-members/TestCppUnionStaticMembers.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
import lldbsuite.test.lldbutil as lldbutil
99

1010
class CppUnionStaticMembersTestCase(TestBase):
11-
def test(self):
11+
def test_print_union(self):
1212
"""Tests that frame variable and expr work
13-
for union static data members"""
13+
for union with static data members"""
1414
self.build()
1515

1616
(target, process, main_thread, _) = lldbutil.run_to_source_breakpoint(
1717
self, "return 0", lldb.SBFileSpec("main.cpp")
18-
)
18+
)
1919

2020
self.expect("frame variable foo", substrs=["val = 42"])
2121
self.expect("frame variable bar", substrs=["val = 137"])
@@ -27,6 +27,16 @@ def test(self):
2727
name="val", value="137"
2828
)])
2929

30+
@expectedFailureWindows
31+
def test_expr_union_static_members(self):
32+
"""Tests that frame variable and expr work
33+
for union static data members"""
34+
self.build()
35+
36+
(target, process, main_thread, _) = lldbutil.run_to_source_breakpoint(
37+
self, "return 0", lldb.SBFileSpec("main.cpp")
38+
)
39+
3040
self.expect_expr("Foo::sVal1", result_type="const int", result_value="-42")
3141
self.expect_expr("Foo::sVal2", result_type="Foo", result_children=[ValueCheck(
3242
name="val", value="42"
@@ -37,6 +47,12 @@ def test_union_in_anon_namespace(self):
3747
"""Tests that frame variable and expr work
3848
for union static data members in anonymous
3949
namespaces"""
50+
self.build()
51+
52+
(target, process, main_thread, _) = lldbutil.run_to_source_breakpoint(
53+
self, "return 0", lldb.SBFileSpec("main.cpp")
54+
)
55+
4056
self.expect_expr("Bar::sVal1", result_type="const int", result_value="-137")
4157
self.expect_expr("Bar::sVal2", result_type="Bar", result_children=[ValueCheck(
4258
name="val", value="137"

0 commit comments

Comments
 (0)