Skip to content

Commit f27619d

Browse files
committed
Test: Enable additional tests on Windows
Enabled additional tests on Windows Since all tests on Windows are either enabled, or are skipped with an associated GitHub issue, update the XCTSkipOnWindows(...) helper API to require providing a reson as to why the test is being skipped. Fixes: #8433 Issue: rdar://148248105
1 parent d6f2ee6 commit f27619d

File tree

5 files changed

+7
-35
lines changed

5 files changed

+7
-35
lines changed

Sources/_InternalTestSupport/XCTAssertHelpers.swift

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,13 @@ public func XCTSkipIfselfHostedCI(because reason: String, file: StaticString = #
6161
}
6262
}
6363

64-
public func XCTSkipOnWindows(because reason: String? = nil, skipPlatformCi: Bool = false, skipSelfHostedCI: Bool = false , file: StaticString = #filePath, line: UInt = #line) throws {
64+
public func XCTSkipOnWindows(because reason: String, skipPlatformCi: Bool = false, skipSelfHostedCI: Bool = false , file: StaticString = #filePath, line: UInt = #line) throws {
6565
#if os(Windows)
66-
let failureCause: String
67-
if let reason {
68-
failureCause = " because \(reason.description)"
69-
} else {
70-
failureCause = ""
71-
}
66+
let failureCause = "Skipping because \(reason.description)"
7267
if (skipPlatformCi) {
73-
try XCTSkipIfPlatformCI(because: "Test is run in Platform CI. Skipping\(failureCause)", file: file, line: line)
74-
}
75-
76-
if (skipSelfHostedCI) {
77-
try XCTSkipIfselfHostedCI(because: "Test is run in Self hosted CI. Skipping\(failureCause)", file: file, line: line)
68+
try XCTSkipIfPlatformCI(because: "Test is run in Platform CI. \(failureCause)", file: file, line: line)
69+
} else if skipSelfHostedCI {
70+
try XCTSkipIfselfHostedCI(because: "Test is run in Self hosted CI. \(failureCause)", file: file, line: line)
7871
}
7972

8073
if (!skipPlatformCi && !skipSelfHostedCI) {

Tests/PackageGraphPerformanceTests/PackageGraphPerfTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ final class PackageGraphPerfTests: XCTestCasePerf {
167167
}
168168

169169
func testRecursiveDependencies() throws {
170-
try XCTSkipOnWindows()
171-
172170
var resolvedTarget = ResolvedModule.mock(packageIdentity: "pkg", name: "t0")
173171
for i in 1..<1000 {
174172
resolvedTarget = ResolvedModule.mock(packageIdentity: "pkg", name: "t\(i)", deps: resolvedTarget)

Tests/WorkspaceTests/ManifestSourceGenerationTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ final class ManifestSourceGenerationTests: XCTestCase {
233233
}
234234

235235
func testAdvancedFeatures() async throws {
236-
try XCTSkipOnWindows()
236+
try XCTSkipOnWindows(because: "https://github.com/swiftlang/swift-package-manager/issues/8602: TSCBasic/Path.swift:969: Assertion failed")
237237

238238
let manifestContents = """
239239
// swift-tools-version:5.3

Tests/WorkspaceTests/RegistryPackageContainerTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ import XCTest
2424
import struct TSCUtility.Version
2525

2626
final class RegistryPackageContainerTests: XCTestCase {
27-
28-
override func setUpWithError() throws {
29-
try XCTSkipOnWindows()
30-
}
31-
3227
func testToolsVersionCompatibleVersions() async throws {
3328
let fs = InMemoryFileSystem()
3429
try fs.createMockToolchain()

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,6 @@ import struct TSCBasic.ByteString
2828
import struct TSCUtility.Version
2929

3030
final class WorkspaceTests: XCTestCase {
31-
// override func setUpWithError() throws {
32-
// let windowsPassingTests = [
33-
// #selector(self.testBinaryArtifactsInvalidPath),
34-
// #selector(self.testManifestLoaderDiagnostics),
35-
// #selector(self.testInterpreterFlags),
36-
// #selector(self.testManifestParseError),
37-
// #selector(self.testSimpleAPI)
38-
// ]
39-
// let matches = windowsPassingTests.filter { $0 == self.invocation?.selector}
40-
// if matches.count == 0 {
41-
// try XCTSkipOnWindows()
42-
// }
43-
// }
44-
4531
func testBasics() async throws {
4632
let sandbox = AbsolutePath("/tmp/ws/")
4733
let fs = InMemoryFileSystem()
@@ -8036,7 +8022,7 @@ final class WorkspaceTests: XCTestCase {
80368022

80378023
func testArtifactChecksum() async throws {
80388024
try XCTSkipOnWindows(because: #"""
8039-
threw error "\tmp\ws doesn't exist in file system" because there is an issue with InMemoryFileSystem readFileContents(...) on Windows
8025+
https://github.com/swiftlang/swift-package-manager/issues/8615: threw error "\tmp\ws doesn't exist in file system" because there is an issue with InMemoryFileSystem readFileContents(...) on Windows
80408026
"""#)
80418027

80428028
let fs = InMemoryFileSystem()

0 commit comments

Comments
 (0)