Skip to content

Commit

Permalink
Works around SPM test scraping bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Mar 19, 2024
1 parent 8641f6e commit 5e318b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Expand Up @@ -62,4 +62,4 @@ jobs:
xcrun xcodebuild -configuration ${{ matrix.configuration }} -scheme DummyTestee -destination 'platform=macOS' test
- name: Swift Package Manager
run: swift test
run: swift test -Xswiftc -DBUILDING_WITH_SWIFT_PACKAGE_MANAGER=1
6 changes: 6 additions & 0 deletions Tests/Tests.swift
Expand Up @@ -28,11 +28,14 @@ struct StructsAreNotTestCases {
XCTFail("This shouldn't run")
}

// Work around https://github.com/apple/swift-package-manager/issues/7411
#if !os(Windows) && !os(Linux) || !BUILDING_WITH_SWIFT_PACKAGE_MANAGER
class NestedStructClassesCanBeTestCases: XCTestCase {

func testNestedClassMethodsCanBeTests() {}

}
#endif

}

Expand All @@ -42,11 +45,14 @@ enum EnumsAreNotTestCases {
XCTFail("This shouldn't run")
}

// Work around https://github.com/apple/swift-package-manager/issues/7411
#if !os(Windows) && !os(Linux) || !BUILDING_WITH_SWIFT_PACKAGE_MANAGER
class NestedEnumClassesCanBeTestCases: XCTestCase {

func testNestedClassMethodsCanBeTests() {}

}
#endif

}

Expand Down

0 comments on commit 5e318b6

Please sign in to comment.