-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Generate entrypoints for test bundles on macOS #9018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ struct TestCommandTests { | |
} | ||
|
||
@Test( | ||
.SWBINTTODO("Windows: Driver threw unable to load output file map"), | ||
.SWBINTTODO("Custom runners should disable entrypoint generation when appropriate"), | ||
arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, | ||
) | ||
func toolsetRunner( | ||
|
@@ -145,22 +145,12 @@ struct TestCommandTests { | |
#expect(stdout.contains("\(fixturePath)")) | ||
|
||
// swift-build-tool output should go to stderr. | ||
withKnownIssue { | ||
#expect(stderr.contains("Compiling")) | ||
} when: { | ||
buildSystem == .swiftbuild // && ProcessInfo.hostOperatingSystem != .macOS | ||
} | ||
#expect(stderr.contains("Compiling")) | ||
|
||
withKnownIssue { | ||
#expect(stderr.contains("Linking")) | ||
} when: { | ||
buildSystem == .swiftbuild // && ProcessInfo.hostOperatingSystem != .macOS | ||
} | ||
#expect(stderr.contains("Linking")) | ||
} | ||
} when: { | ||
(buildSystem == .swiftbuild && ProcessInfo.hostOperatingSystem == .windows) | ||
|| (buildSystem == .swiftbuild && ProcessInfo.hostOperatingSystem == .linux && CiEnvironment.runningInSmokeTestPipeline) | ||
|| (buildSystem == .swiftbuild && ProcessInfo.hostOperatingSystem == .linux && CiEnvironment.runningInSelfHostedPipeline) // error: SwiftCompile normal x86_64 /tmp/Miscellaneous_EchoExecutable.sxkNTX/Miscellaneous_EchoExecutable/.build/x86_64-unknown-linux-gnu/Intermediates.noindex/EchoExecutable.build/Debug-linux/TestSuite-test-runner.build/DerivedSources/test_entry_point.swift failed with a nonzero exit code | ||
buildSystem == .swiftbuild | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (possibly-blocking): this has a catch all, while the previous changes were targeting specific issues on the platforms. It can be argued the test was passing on macOS, except we were not seeing the expected outputs, which may be expected for SwiftBuild. What is the plan to address this? |
||
} | ||
} | ||
|
||
|
@@ -242,9 +232,7 @@ struct TestCommandTests { | |
#expect(result.stderr.contains("-enable-testing")) | ||
} | ||
} when: { | ||
(buildSystem == .swiftbuild && .linux == ProcessInfo.hostOperatingSystem) | ||
// || (buildSystem == .swiftbuild && .windows == ProcessInfo.hostOperatingSystem && CiEnvironment.runningInSelfHostedPipeline) | ||
|| (buildSystem == .swiftbuild && .windows == ProcessInfo.hostOperatingSystem ) | ||
buildSystem == .swiftbuild | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (possibly-blocking): this seems like a regression as this was previously passing on macOs, but is not failing. Why is the plan to address this? |
||
} | ||
} | ||
|
||
|
@@ -278,7 +266,7 @@ struct TestCommandTests { | |
) | ||
} | ||
} when: { | ||
buildSystem == .swiftbuild && ProcessInfo.hostOperatingSystem == .windows | ||
buildSystem == .swiftbuild | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (possibly-blocking): this seems like a regression as this is now failing on all platforms, while it was previously only failing on Windows. Why is the plan to address this? |
||
} | ||
} | ||
|
||
|
@@ -300,8 +288,7 @@ struct TestCommandTests { | |
#expect(result.stderr.contains("-enable-testing")) | ||
} | ||
} when: { | ||
(buildSystem == .swiftbuild && .windows == ProcessInfo.hostOperatingSystem) | ||
|| (buildSystem == .swiftbuild && .linux == ProcessInfo.hostOperatingSystem && CiEnvironment.runningInSelfHostedPipeline) | ||
buildSystem == .swiftbuild | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as before. |
||
} | ||
} | ||
|
||
|
@@ -667,7 +654,6 @@ struct TestCommandTests { | |
} when: { | ||
(buildSystem == .swiftbuild && .linux == ProcessInfo.hostOperatingSystem) | ||
|| ProcessInfo.hostOperatingSystem == .windows | ||
|| (buildSystem == .swiftbuild && .macOS == ProcessInfo.hostOperatingSystem && tcdata.testRunner == .SwiftTesting) | ||
} | ||
} | ||
|
||
|
@@ -994,29 +980,23 @@ struct TestCommandTests { | |
} | ||
|
||
@Test( | ||
.SWBINTTODO("Fails to find test executable"), | ||
.issue("https://github.com/swiftlang/swift-package-manager/pull/8722", relationship: .fixedBy), | ||
arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, | ||
) | ||
func basicSwiftTestingIntegration( | ||
buildSystem: BuildSystemProvider.Kind, | ||
configuration: BuildConfiguration, | ||
) async throws { | ||
try await withKnownIssue("Fails to find the test executable") { | ||
try await fixture(name: "Miscellaneous/TestDiscovery/SwiftTesting") { fixturePath in | ||
let (stdout, stderr) = try await execute( | ||
["--enable-swift-testing", "--disable-xctest"], | ||
packagePath: fixturePath, | ||
configuration: configuration, | ||
buildSystem: buildSystem, | ||
) | ||
#expect( | ||
stdout.contains(#"Test "SOME TEST FUNCTION" started"#), | ||
"Expectation not met. got '\(stdout)'\nstderr: '\(stderr)'" | ||
) | ||
} | ||
} when: { | ||
buildSystem == .swiftbuild | ||
try await fixture(name: "Miscellaneous/TestDiscovery/SwiftTesting") { fixturePath in | ||
let (stdout, stderr) = try await execute( | ||
["--enable-swift-testing", "--disable-xctest"], | ||
packagePath: fixturePath, | ||
configuration: configuration, | ||
buildSystem: buildSystem, | ||
) | ||
#expect( | ||
stdout.contains(#"Test "SOME TEST FUNCTION" started"#), | ||
"Expectation not met. got '\(stdout)'\nstderr: '\(stderr)'" | ||
) | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macOS, or all Darwin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we don't support command-line execution of tests on other Apple platforms anyway, so...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Execution doesn't matter, this is about the build. The build system does not assume that the machine/tool building the tests is the one running them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay: we support neither building nor executing tests on iOS using SwiftPM.