Skip to content

Tests: adjust for sorting and path representation #7112

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

Merged
merged 1 commit into from
Nov 27, 2023
Merged
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
17 changes: 8 additions & 9 deletions Tests/BuildTests/LLBuildManifestBuilderTests.swift
Original file line number Diff line number Diff line change
@@ -67,14 +67,14 @@ final class LLBuildManifestBuilderTests: XCTestCase {
try llbuild.createProductCommand(buildProduct)

let basicReleaseCommandNames = [
"/path/to/build/release/exe.product/Objects.LinkFileList",
AbsolutePath("/path/to/build/release/exe.product/Objects.LinkFileList").pathString,
"<exe-release.exe>",
"C.exe-release.exe",
]

XCTAssertEqual(
llbuild.manifest.commands.map(\.key).sorted(),
basicReleaseCommandNames
basicReleaseCommandNames.sorted()
)

// macOS, debug build
@@ -98,18 +98,17 @@ final class LLBuildManifestBuilderTests: XCTestCase {

let entitlementsCommandName = "C.exe-debug.exe-entitlements"
let basicDebugCommandNames = [
"/path/to/build/debug/exe.product/Objects.LinkFileList",
AbsolutePath("/path/to/build/debug/exe.product/Objects.LinkFileList").pathString,
"<exe-debug.exe>",
"C.exe-debug.exe",
]

XCTAssertEqual(
llbuild.manifest.commands.map(\.key).sorted(),
[
"/path/to/build/debug/exe-entitlement.plist",
] + basicDebugCommandNames + [
(basicDebugCommandNames + [
AbsolutePath("/path/to/build/debug/exe-entitlement.plist").pathString,
entitlementsCommandName,
]
]).sorted()
)

guard let entitlementsCommand = llbuild.manifest.commands[entitlementsCommandName]?.tool as? ShellTool else {
@@ -152,7 +151,7 @@ final class LLBuildManifestBuilderTests: XCTestCase {

XCTAssertEqual(
llbuild.manifest.commands.map(\.key).sorted(),
basicReleaseCommandNames
basicReleaseCommandNames.sorted()
)

// Linux, debug build
@@ -176,7 +175,7 @@ final class LLBuildManifestBuilderTests: XCTestCase {

XCTAssertEqual(
llbuild.manifest.commands.map(\.key).sorted(),
basicDebugCommandNames
basicDebugCommandNames.sorted()
)
}
}
2 changes: 1 addition & 1 deletion Tests/BuildTests/ModuleAliasingBuildTests.swift
Original file line number Diff line number Diff line change
@@ -4692,7 +4692,7 @@ final class ModuleAliasingBuildTests: XCTestCase {

XCTFail("unexpectedly resolved the package graph successfully")
} catch {
XCTAssertEqual(error.interpolationDescription, "multiple products named 'SomeProduct' in: 'other' (at '/Other'), 'some' (at '/Some')")
XCTAssertEqual(error.interpolationDescription, "multiple products named 'SomeProduct' in: 'other' (at '\(AbsolutePath("/Other"))'), 'some' (at '\(AbsolutePath("/Some"))')")
}
XCTAssertEqual(observability.diagnostics.map { $0.description }.sorted(), ["[warning]: product aliasing requires tools-version 5.2 or later, so it is not supported by \'other\'", "[warning]: product aliasing requires tools-version 5.2 or later, so it is not supported by \'some\'"])
}