You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?
Confirmed reproduction steps with SwiftPM CLI.
Description
A test file containing the following will cause the test to fail to compile on Linux or Windows. These work on macOS, and my test scraper can successfully run them on Linux or Windows:
Both of the XXXCanBeTests functions run as part of testing and tests pass.
Actual behavior
[281/286] Emitting module SwiftCMakeXCTestingPackageDiscoveredTests
/home/runner/work/GenerateSwiftXCTestMain/GenerateSwiftXCTestMain/.build/x86_64-unknown-linux-gnu/debug/SwiftCMakeXCTestingPackageDiscoveredTests.derived/Tests.swift:4:23: error: cannot find type 'NestedEnumClassesCanBeTestCases' in scope
fileprivate extension NestedEnumClassesCanBeTestCases {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/GenerateSwiftXCTestMain/GenerateSwiftXCTestMain/.build/x86_64-unknown-linux-gnu/debug/SwiftCMakeXCTestingPackageDiscoveredTests.derived/Tests.swift:11:23: error: cannot find type 'NestedStructClassesCanBeTestCases' in scope
fileprivate extension NestedStructClassesCanBeTestCases {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[282/286] Compiling SwiftCMakeXCTestingPackageDiscoveredTests Tests.swift
/home/runner/work/GenerateSwiftXCTestMain/GenerateSwiftXCTestMain/.build/x86_64-unknown-linux-gnu/debug/SwiftCMakeXCTestingPackageDiscoveredTests.derived/Tests.swift:4:23: error: cannot find type 'NestedEnumClassesCanBeTestCases' in scope
fileprivate extension NestedEnumClassesCanBeTestCases {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/GenerateSwiftXCTestMain/GenerateSwiftXCTestMain/.build/x86_64-unknown-linux-gnu/debug/SwiftCMakeXCTestingPackageDiscoveredTests.derived/Tests.swift:11:23: error: cannot find type 'NestedStructClassesCanBeTestCases' in scope
fileprivate extension NestedStructClassesCanBeTestCases {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/GenerateSwiftXCTestMain/GenerateSwiftXCTestMain/.build/x86_64-unknown-linux-gnu/debug/SwiftCMakeXCTestingPackageDiscoveredTests.derived/Tests.swift:28:18: error: cannot find 'NestedEnumClassesCanBeTestCases' in scope
testCase(NestedEnumClassesCanBeTestCases.__allTests__NestedEnumClassesCanBeTestCases),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/GenerateSwiftXCTestMain/GenerateSwiftXCTestMain/.build/x86_64-unknown-linux-gnu/debug/SwiftCMakeXCTestingPackageDiscoveredTests.derived/Tests.swift:29:18: error: cannot find 'NestedStructClassesCanBeTestCases' in scope
testCase(NestedStructClassesCanBeTestCases.__allTests__NestedStructClassesCanBeTestCases),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/GenerateSwiftXCTestMain/GenerateSwiftXCTestMain/.build/x86_64-unknown-linux-gnu/debug/SwiftCMakeXCTestingPackageDiscoveredTests.derived/Tests.swift:7:46: error: cannot find 'testNestedClassMethodsCanBeTests' in scope
("testNestedClassMethodsCanBeTests", testNestedClassMethodsCanBeTests),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/GenerateSwiftXCTestMain/GenerateSwiftXCTestMain/.build/x86_64-unknown-linux-gnu/debug/SwiftCMakeXCTestingPackageDiscoveredTests.derived/Tests.swift:14:46: error: cannot find 'testNestedClassMethodsCanBeTests' in scope
("testNestedClassMethodsCanBeTests", testNestedClassMethodsCanBeTests),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: fatalError
error: fatalError
Error: Process completed with exit code 1.
Steps to reproduce
Put the snippet in a test and swift build --build-tests on Linux or Windows.
Swift Package Manager version/commit hash
5.9.0
Swift & OS version (output of swift --version ; uname -a)
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
Darwin DaveA-MBP14-5.localdomain 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered:
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?Description
A test file containing the following will cause the test to fail to compile on Linux or Windows. These work on macOS, and my test scraper can successfully run them on Linux or Windows:
Expected behavior
Both of the
XXXCanBeTests
functions run as part of testing and tests pass.Actual behavior
Steps to reproduce
Put the snippet in a test and
swift build --build-tests
on Linux or Windows.Swift Package Manager version/commit hash
5.9.0
Swift & OS version (output of
swift --version ; uname -a
)swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0
Darwin DaveA-MBP14-5.localdomain 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered: