Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions lldb/packages/Python/lldbsuite/test/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,12 +1085,36 @@ def decorate(func):
return decorate

def skipEmbeddedSwift(func):
"""Skip a test that ought to work in embedded Swift but currently doesn't.
Use this when the test's inferior builds and runs as embedded Swift and the
debugger is what gets the wrong answer -- i.e. a gap in LLDB's embedded

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

second half of this sentence reads weird

support that is expected to be closed. For a test whose own source cannot be
compiled as embedded Swift at all, use `requiresNonEmbeddedSwift` instead so
the two populations stay distinguishable.
"""
def skip_fn(swift_embedded=None, **kwargs):
if swift_embedded == "swiftembed":
return "not supported in embedded Swift"
return None
return _skipForVariant("swift_embedded", skip_fn, func)

def requiresNonEmbeddedSwift(func):
"""Skip a test whose own source requires non-embedded Swift.
Behaves exactly like `skipEmbeddedSwift`; the separate name records that the
test cannot run as embedded Swift because the inferior does not compile in
that mode -- it imports Foundation or another ObjC module, enables library
evolution, uses `_Concurrency`, or relies on a language feature Embedded

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isnt' there concurrency support in embedded Swift?

Swift rejects. Nothing in LLDB can make these pass, so they should not be
counted against embedded debugging support.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last sentence is unclear.

"""
def skip_fn(swift_embedded=None, **kwargs):
if swift_embedded == "swiftembed":
return "test requires non-embedded Swift"
return None
return _skipForVariant("swift_embedded", skip_fn, func)

def skipEmbeddedSwiftOnLinux(func):
def skip_fn(swift_embedded=None, **kwargs):
if swift_embedded == "swiftembed" and lldbplatformutil.getPlatform() == "linux":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import lldbsuite.test.lldbutil as lldbutil

class TestCase(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_swift_po_address(self):
self.build()
Expand All @@ -21,7 +21,7 @@ def test_swift_po_address(self):
self.expect(f"dwim-print -O -- 0x{hex_addr}", patterns=[f"Object@0x0*{hex_addr}"])
self.expect(f"dwim-print -O -- {addr}", patterns=[f"Object@0x0*{hex_addr}"])

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_swift_po_non_address_hex(self):
"""No special handling of non-memory integer values."""
Expand All @@ -31,7 +31,7 @@ def test_swift_po_non_address_hex(self):
)
self.expect(f"dwim-print -O -- 0x1000", substrs=["4096"])

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_print_swift_object_does_not_show_name(self):
"""Ensure that objects are printed without a name, and without the '='
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@


class TestCase(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
@skipUnlessDarwin
def test_objc_self(self):
self.build()
lldbutil.run_to_source_breakpoint(self, "check self", lldb.SBFileSpec("main.swift"))
self.expect("frame variable _prop", startstr="(Int) _prop = 30")

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
@skipUnlessDarwin
def test_objc_self_capture_idiom(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AsanSwiftTestCase(lldbtest.TestBase):

mydir = lldbtest.TestBase.compute_mydir(__file__)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
@skipIfWindows
@skipIfLinux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,29 @@

@skipIfWindows
class TestSwiftErrorBreakpoint(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@decorators.skipIfLinux # <rdar://problem/30909618>
@swiftTest
def test_swift_error_no_typename(self):
"""Tests that swift error throws are correctly caught by the Swift Error breakpoint"""
self.build()
self.do_tests(None)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_swift_error_matching_base_typename(self):
"""Tests that swift error throws are correctly caught by the Swift Error breakpoint"""
self.build()
self.do_tests("EnumError")

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_swift_error_matching_full_typename(self):
"""Tests that swift error throws are correctly caught by the Swift Error breakpoint"""
self.build()
self.do_tests("a.EnumError")

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_swift_error_bogus_typename(self):
"""Tests that swift error throws are correctly caught by the Swift Error breakpoint"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class TestCase(TestBase):

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
@skipUnlessFoundation
def test(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class TestCase(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@skipUnlessFoundationEssentials
@skipIfLinux # https://github.com/swiftlang/llvm-project/issues/13465
@swiftTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class TestCase(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@skipUnlessFoundationEssentials
@skipIfLinux # https://github.com/swiftlang/llvm-project/issues/13465
@swiftTest
Expand Down Expand Up @@ -77,7 +77,7 @@ def test_swift_string_index_formatters_native(self):
],
)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@skipUnlessFoundation
@swiftTest
def test_swift_string_index_formatters_bridged(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class TestCase(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_swift_substring_formatters(self):
"""Test Subtring summary strings."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class MTCSwiftPropertyTestCase(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@skipUnlessDarwin
@swiftTest
def test(self):
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/API/functionalities/mtc/swift/TestSwiftMTC.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class MTCSwiftTestCase(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@skipUnlessDarwin
@swiftTest
def test(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def setUp(self):
self.listener = lldbutil.start_listening_from(self.broadcaster,
lldb.SBDebugger.eBroadcastBitProgress)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
# Don't run ClangImporter tests if Clangimporter is disabled.
@skipIf(setting=('symbols.use-swift-clangimporter', 'false'))
@skipUnlessDarwin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SwiftRuntimeReportingExclusivityViolationTestCase(lldbtest.TestBase):
mydir = lldbtest.TestBase.compute_mydir(__file__)

@decorators.swiftTest
@decorators.skipEmbeddedSwift
@decorators.requiresNonEmbeddedSwift
@decorators.skipIfLinux
@decorators.expectedFailureWindows
def test_swift_runtime_reporting(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TsanSwiftAccessRaceTestCase(lldbtest.TestBase):

mydir = lldbtest.TestBase.compute_mydir(__file__)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
@skipIfWindows
@skipIfLinux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TsanSwiftTestCase(lldbtest.TestBase):

mydir = lldbtest.TestBase.compute_mydir(__file__)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
@skipIfWindows
@skipIfLinux
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *

lldbinline.MakeInlineTest(__file__, globals(), decorators=[skipEmbeddedSwift, swiftTest])
lldbinline.MakeInlineTest(__file__, globals(), decorators=[requiresNonEmbeddedSwift, swiftTest])
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def check_variable(self, name, is_reference, contents = 0):
self.assertSuccess(error)


@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test(self):
self.build()
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/API/lang/swift/any/TestSwiftAnyType.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TestSwiftAnyType(lldbtest.TestBase):

mydir = lldbtest.TestBase.compute_mydir(__file__)

@skipEmbeddedSwift
@skipEmbeddedSwiftOnWindows
@swiftTest
def test_any_type(self):
"""Test the Any type"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@


class TestSwiftArchetypeResolution(TestBase):
@skipEmbeddedSwift
@skipEmbeddedSwiftOnLinux # the embedded stdlib's hashing seed needs arc4random_buf, which does not link on Linux.
@skipEmbeddedSwiftOnWindows
@swiftTest
def test_swift_archetype_resolution(self):
"""Test that archetype-typed objects get resolved to their proper location in memory"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *

lldbinline.MakeInlineTest(__file__, globals(), decorators=[skipEmbeddedSwift, swiftTest])
lldbinline.MakeInlineTest(__file__, globals(), decorators=[requiresNonEmbeddedSwift, swiftTest])
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *

lldbinline.MakeInlineTest(__file__, globals(), decorators=[skipEmbeddedSwift,
lldbinline.MakeInlineTest(__file__, globals(), decorators=[requiresNonEmbeddedSwift,
swiftTest, skipUnlessFoundation])
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *

lldbinline.MakeInlineTest(__file__, globals(), decorators=[skipEmbeddedSwift, swiftTest])
lldbinline.MakeInlineTest(__file__, globals(), decorators=[requiresNonEmbeddedSwift, swiftTest])
2 changes: 1 addition & 1 deletion lldb/test/API/lang/swift/array_enum/TestArrayEnum.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *

lldbinline.MakeInlineTest(__file__, globals(), decorators=[skipEmbeddedSwift, swiftTest])
lldbinline.MakeInlineTest(__file__, globals(), decorators=[requiresNonEmbeddedSwift, swiftTest])
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *

lldbinline.MakeInlineTest(__file__, globals(), decorators=[skipEmbeddedSwift,
lldbinline.MakeInlineTest(__file__, globals(), decorators=[requiresNonEmbeddedSwift,
swiftTest, skipUnlessDarwin,
expectedFailureAll(archs=['arm64_32'], bugnumber="<rdar://problem/58065423>")])
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class TestSwiftArrayUninitialized(lldbtest.TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test(self):
"""Test unitialized global arrays"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class TestSwiftArtificialSubclass(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@skipUnlessObjCInterop
@swiftTest
def test(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *

lldbinline.MakeInlineTest(__file__, globals(), decorators=[skipEmbeddedSwift, swiftTest])
lldbinline.MakeInlineTest(__file__, globals(), decorators=[requiresNonEmbeddedSwift, swiftTest])
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


class TestSwiftArchetypeResolution(TestBase):
@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_swift_associated_type_resolution(self):
"""Test that archetype-typed objects get resolved to their proper location in memory"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class TestCase(TestBase):

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_actor_unprioritised_jobs(self):
"""Verify that an actor exposes its unprioritised jobs (queue)."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TestSwiftAsyncFnArgs(lldbtest.TestBase):

mydir = lldbtest.TestBase.compute_mydir(__file__)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
@skipIf(oslist=['windows',])
def test(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class TestCase(TestBase):

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_unsafe_continuation_printing(self):
"""Print an UnsafeContinuation and verify its children."""
Expand All @@ -34,7 +34,7 @@ def test_unsafe_continuation_printing(self):
],
)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_checked_continuation_printing(self):
"""Print an CheckedContinuation and verify its children."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class TestSwiftAsyncExpressions(lldbtest.TestBase):

mydir = lldbtest.TestBase.compute_mydir(__file__)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
@skipIf(archs=no_match(["aarch", "arm64", "arm64e", "arm64_32", "x86_64"]))
def test_actor(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class TestCase(TestBase):

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_top_level_task(self):
"""Test Task synthetic child provider for top-level Task."""
Expand All @@ -34,7 +34,7 @@ def test_top_level_task(self):
],
)

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@swiftTest
def test_current_task(self):
"""Test Task synthetic child for UnsafeCurrentTask (from an async let)."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class TestCase(TestBase):

@skipEmbeddedSwift
@requiresNonEmbeddedSwift
@skipUnlessDarwin
@swiftTest
def test(self):
Expand Down
Loading