Skip to content

[Windows] Use a multiroot data file to test (corelibs-)foundation on Windows #80122

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions utils/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2410,12 +2410,17 @@ function Build-Foundation {
}

function Test-Foundation {
$ScratchPath = "$BinaryCache\$($BuildPlatform.Triple)\FoundationTests"

# Foundation tests build via swiftpm rather than CMake
Build-SPMProject `
-Action Test `
-Src $SourceCache\swift-foundation `
-Bin "$BinaryCache\$($BuildPlatform.Triple)\CoreFoundationTests" `
-Platform $BuildPlatform
-Bin "$ScratchPath" `
-Platform $BuildPlatform `
-Configuration $FoundationTestConfiguration `
Copy link
Contributor

Choose a reason for hiding this comment

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

Is $FoundationTestConfiguration defined somewhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, defaults to debug:

.PARAMETER FoundationTestConfiguration
Whether to run swift-foundation and swift-corelibs-foundation tests in a debug or release configuration.
...
  [ValidateSet("debug", "release")]
  [string] $FoundationTestConfiguration = "debug",

Should we do the same thing on Linux to keep our test environments consistent between the two platforms?

I had thought we were, but... apparently not 🤔

--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
--test-product swift-foundationPackageTests

Invoke-IsolatingEnvVars {
$env:DISPATCH_INCLUDE_PATH="$(Get-SwiftSDK Windows)/usr/include"
Expand All @@ -2427,9 +2432,11 @@ function Test-Foundation {
Build-SPMProject `
-Action Test `
-Src $SourceCache\swift-corelibs-foundation `
-Bin "$BinaryCache\$($BuildPlatform.Triple)\FoundationTests" `
-Bin "$ScratchPath" `
-Platform $BuildPlatform `
-Configuration $FoundationTestConfiguration
-Configuration $FoundationTestConfiguration `
--multiroot-data-file "$SourceCache\swift\utils\build_swift\resources\SwiftPM-Unified-Build.xcworkspace" `
--test-product swift-corelibs-foundationPackageTests
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.