Skip to content

Conversation

@daveinglis
Copy link
Contributor

Fix various tests so they pass on Windows

@daveinglis
Copy link
Contributor Author

@swift-ci test

basename = String(basename.dropLast(4))
}
if basename == "/" {
if basename == "/" || basename == "\\" {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should have a single central variable that is an array of the possible path separators for the host.

See https://github.com/swiftlang/swift-build/blob/bc2e7d92d36caed0399f64594b9e5518b2f83731/Sources/SWBUtil/Path.swift#L69 for example.

There might already be one in the SwiftPM codebase somewhere, or in TSC.

Also, this part of the logic should probably be constrained to file URLs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya, I couldn't find a central definition for path separators like whats in swift-build, and it looks like from this https://github.com/swiftlang/swift-package-manager/pull/6706/files we moved away from URL

Copy link
Contributor

Choose a reason for hiding this comment

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

I like python's take on the separator by storing in a variable. e.g.: os.sep. Should we consider something similar for Swift?

@daveinglis
Copy link
Contributor Author

@swift-ci test

@daveinglis
Copy link
Contributor Author

@swift-ci test windows

@daveinglis daveinglis force-pushed the test_fixes branch 2 times, most recently from fb81f29 to 12e88df Compare November 24, 2025 15:37
Copy link
Contributor

@bkhouri bkhouri left a comment

Choose a reason for hiding this comment

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

It's great to see tests being enabled for Windows!

basename = String(basename.dropLast(4))
}
if basename == "/" {
if basename == "/" || basename == "\\" {
Copy link
Contributor

Choose a reason for hiding this comment

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

I like python's take on the separator by storing in a variable. e.g.: os.sep. Should we consider something similar for Swift?

}
} when: {
ProcessInfo.isHostAmazonLinux2()
ProcessInfo.isHostAmazonLinux2() //rdar://134238535
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: can we references a GitHub issue instead?

await XCTAssertBuilds(
fixturePath,
Xswiftc: ["-warnings-as-errors"],
buildSystem: .native,
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: this suite is verifying the native build system. can we migrate this suite to SwiftTesting and ensure we verify the SwiftBuild build system too?

This comment applies to all applicable XCTestCase

.IssueWindowsLongPath,
.IssueWindowsPathLastComponent,
.IssueWindowsRelativePathAssert,
.tags(
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (blocking): ca we keep the .tags(...) associated with this test?

- also mark withKnownIssues tests as isIntermittent: true so that as we
  fix things in dependent packages (like swift-build) we don't break
  swiftPM CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants