Skip to content
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
26 changes: 0 additions & 26 deletions Fixtures/Coverage/Simple/Package.swift

This file was deleted.

10 changes: 0 additions & 10 deletions Fixtures/Coverage/Simple/Sources/Simple/Simple.swift

This file was deleted.

24 changes: 0 additions & 24 deletions Fixtures/Coverage/Simple/Tests/SimpleTests/SimpleTests.swift

This file was deleted.

31 changes: 3 additions & 28 deletions Sources/Commands/SwiftTestCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import ArgumentParser

@_spi(SwiftPMInternal)
import Basics
import struct Basics.Triple

import _Concurrency

Expand Down Expand Up @@ -598,11 +597,7 @@ public struct SwiftTestCommand: AsyncSwiftCommand {
for product in testProducts {
// Export the codecov data as JSON.
let jsonPath = productsBuildParameters.codeCovAsJSONPath(packageName: rootManifest.displayName)
try await exportCodeCovAsJSON(
to: jsonPath,
testBinary: product.binaryPath,
swiftCommandState: swiftCommandState,
)
try await exportCodeCovAsJSON(to: jsonPath, testBinary: product.binaryPath, swiftCommandState: swiftCommandState)
}
}

Expand All @@ -624,6 +619,7 @@ public struct SwiftTestCommand: AsyncSwiftCommand {
}
}
args += ["-o", productsBuildParameters.codeCovDataFile.pathString]

try await AsyncProcess.checkNonZeroExit(arguments: args)
}

Expand All @@ -636,17 +632,11 @@ public struct SwiftTestCommand: AsyncSwiftCommand {
// Export using the llvm-cov tool.
let llvmCov = try swiftCommandState.getTargetToolchain().getLLVMCov()
let (productsBuildParameters, _) = try swiftCommandState.buildParametersForTest(options: self.options)
let archArgs: [String] = if let arch = productsBuildParameters.triple.llvmCovArchArgument {
["--arch", "\(arch)"]
} else {
[]
}
let args = [
llvmCov.pathString,
"export",
"-instr-profile=\(productsBuildParameters.codeCovDataFile)",
] + archArgs + [
testBinary.pathString,
testBinary.pathString
]
let result = try await AsyncProcess.popen(arguments: args)

Expand Down Expand Up @@ -719,21 +709,6 @@ extension SwiftTestCommand {
}
}

fileprivate extension Triple {
var llvmCovArchArgument: String? {
guard let arch = self.arch else {
return nil
}
switch arch {
case .aarch64:
// Apple platforms uses arm64
return self.isApple() ? "arm64" : "aarch64"
default:
return "\(arch)"
}
}
}

extension SwiftTestCommand {
struct Last: SwiftCommand {
@OptionGroup(visibility: .hidden)
Expand Down
5 changes: 2 additions & 3 deletions Sources/SwiftBuildSupport/SwiftBuildSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1109,9 +1109,8 @@ public final class SwiftBuildSystem: SPMBuildCore.BuildSystem {

private static func constructTestingSettingsOverrides(from parameters: BuildParameters.Testing) -> [String: String] {
var settings: [String: String] = [:]

// Coverage settings
settings["CLANG_COVERAGE_MAPPING"] = parameters.enableCodeCoverage ? "YES" : "NO"
// TODO: enableCodeCoverage
// explicitlyEnabledTestability

switch parameters.explicitlyEnabledTestability {
case true:
Expand Down
7 changes: 0 additions & 7 deletions Sources/_InternalTestSupport/SwiftTesting+TraitsBug.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ extension Trait where Self == Testing.Bug {
)
}

public static var IssueWindowsPathTestsFailures: Self {
.issue(
"https://github.com/swiftlang/swift-package-manager/issues/8511",
relationship: .defect,
)
}

public static var IssueWindowsCannotSaveAttachment: Self {
// error: unable to write file 'C:\Users\ContainerAdministrator\AppData\Local\Temp\CFamilyTargets_CDynamicLookup.hNxGHC\CFamilyTargets_CDynamicLookup\.build\x86_64-unknown-windows-msvc\Intermediates.noindex\CDynamicLookup.build\Release-windows\CDynamicLookup.build\Objects-normal\x86_64\CDynamicLookup.LinkFileList': No such file or directory (2)
.issue(
Expand Down
24 changes: 5 additions & 19 deletions Tests/BasicsTests/FileSystem/PathTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "/ab/cd/ef/", expected: (windows ? #"\ab\cd\ef"# : "/ab/cd/ef"), label: "Trailing path seperator"),
(path: "/ab/cd/ef//", expected: (windows ? #"\ab\cd\ef"# : "/ab/cd/ef"), label: "Trailing path seperator"),
Expand Down Expand Up @@ -111,7 +110,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "/./a", expected: (windows ? #"\"# : "/")),
(path: "/../..", expected: (windows ? #"\"# : "/")),
Expand Down Expand Up @@ -145,7 +143,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "/../..", expected: "/"),
]
Expand Down Expand Up @@ -181,7 +178,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "/../..", expected: "/"),
]
Expand All @@ -208,7 +204,6 @@ struct PathTests {
#expect(actual == expectedPath)
}
@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "/", numParentDirectoryCalls: 1, expected: "/"),
(path: "/", numParentDirectoryCalls: 2, expected: "/"),
Expand All @@ -220,7 +215,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "/bar/../foo/..//", numParentDirectoryCalls: 2, expected: "/"),
(path: "/bar/../foo/..//yabba/a/b", numParentDirectoryCalls: 2, expected: "/yabba")
Expand All @@ -237,7 +231,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "/", expected: ["/"]),
(path: "/.", expected: ["/"]),
Expand Down Expand Up @@ -375,7 +368,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "ab//cd//ef", expected: (windows ? #"ab\cd\ef"# : "ab/cd/ef"), label: "repeated path seperators"),
(path: "ab//cd///ef", expected: (windows ? #"ab\cd\ef"# : "ab/cd/ef"), label: "repeated path seperators"),
Expand Down Expand Up @@ -448,8 +440,7 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
arguments: [
(path: "../a/..", expected: "."),
(path: "a/..", expected: "."),
(path: "a/../////../////./////", expected: "."),
Expand Down Expand Up @@ -490,7 +481,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "a/..", expected: "."),
(path: "a/../////../////./////", expected: ".."),
Expand Down Expand Up @@ -529,7 +519,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "../..", expected: ".."),
(path: "../a/..", expected: ".."),
Expand Down Expand Up @@ -571,8 +560,7 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments:[
arguments:[
"a.",
".a",
"",
Expand Down Expand Up @@ -613,7 +601,6 @@ struct PathTests {
}

@Test(
.IssueWindowsPathTestsFailures,
arguments: [
(path: "foo/bar/..", expected: ["foo"]),
(path: "bar/../foo", expected: ["foo"]),
Expand All @@ -635,22 +622,21 @@ struct PathTests {
}
}

@Test(
.IssueWindowsPathTestsFailures,
)
@Test
func relativePathValidation() throws {
#expect(throws: Never.self) {
try RelativePath(validating: "a/b/c/d")
}

withKnownIssue("https://github.com/swiftlang/swift-package-manager/issues/8511: \\") {
withKnownIssue {
#expect {try RelativePath(validating: "/a/b/d")} throws: { error in
("\(error)" == "invalid relative path '/a/b/d'; relative path should not begin with '/'")
}
} when: {
ProcessInfo.hostOperatingSystem == .windows
}
}

}

@Test
Expand Down
14 changes: 10 additions & 4 deletions Tests/BasicsTests/HTTPClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,11 @@ struct HTTPClientTests {
var request = HTTPClient.Request(method: .get, url: "http://test")
request.options.validResponseCodes = [200]

await #expect(throws: HTTPClientError.badResponseStatusCode(statusCode)) {
try await httpClient.execute(request)
do {
let response = try await httpClient.execute(request)
Issue.record("unexpected success \(response)")
} catch {
#expect(error as? HTTPClientError == .badResponseStatusCode(statusCode))
}
}

Expand Down Expand Up @@ -404,8 +407,11 @@ struct HTTPClientTests {
var request = HTTPClient.Request(url: "http://test")
request.options.maximumResponseSizeInBytes = 10

await #expect(throws: HTTPClientError.responseTooLarge(maxSize * 2)) {
try await httpClient.execute(request)
do {
let response = try await httpClient.execute(request)
Issue.record("unexpected success \(response)")
} catch {
#expect(error as? HTTPClientError == .responseTooLarge(maxSize * 2))
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/BuildTests/PluginsBuildPlanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct PluginsBuildPlanTests {
.tags(
.Feature.Command.Build,
),
.IssueWindowsPathTestsFailures, // Fails to build the project to due to incorrect Path handling
.issue("https://github.com/swiftlang/swift-package-manager/issues/8511", relationship: .defect), // Fails to build the project to due to incorrect Path handling
arguments: BuildConfiguration.allCases,
)
func buildToolsDatabasePath(
Expand Down
Loading