Skip to content

Commit bcd4a5e

Browse files
committed
FIRST COMMIT: Enable all Windows tests and see which ones fails
Update the Basics/FileSystem/*.swift test to enable more tests that pass on Windows - Update function name to get a sense of which tests are passing on Windows Fixes: swiftlang#8433 Issue: rdar://148248105
1 parent 304833a commit bcd4a5e

28 files changed

+267
-267
lines changed

Sources/_InternalTestSupport/misc.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,16 @@ public func executeSwiftBuild(
277277
return try await SwiftPM.Build.execute(args, packagePath: packagePath, env: env)
278278
}
279279

280-
public func skipOnWindowsAsTestCurrentlyFails(because reason: String? = nil) throws {
281-
#if os(Windows)
282-
let failureCause: String
283-
if let reason {
284-
failureCause = " because \(reason.description)"
285-
} else {
286-
failureCause = ""
287-
}
288-
throw XCTSkip("Test fails on windows\(failureCause)")
289-
#endif
280+
public func skipOnWindowsAsTestCurrentlyFailsDang(because reason: String? = nil) throws {
281+
// #if os(Windows)
282+
// let failureCause: String
283+
// if let reason {
284+
// failureCause = " because \(reason.description)"
285+
// } else {
286+
// failureCause = ""
287+
// }
288+
// throw XCTSkip("Test fails on windows\(failureCause)")
289+
// #endif
290290
}
291291

292292
@discardableResult

Tests/BasicsTests/AsyncProcessTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import func TSCTestSupport.withCustomEnv
2525
final class AsyncProcessTests: XCTestCase {
2626

2727
override func setUp() async throws {
28-
try skipOnWindowsAsTestCurrentlyFails()
28+
try skipOnWindowsAsTestCurrentlyFailsDang()
2929
}
3030

3131
func testBasics() throws {

Tests/BasicsTests/ConcurrencyHelpersTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
import TSCTestSupport
1515
import XCTest
1616

17-
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails
17+
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFailsDang
1818

1919
final class ConcurrencyHelpersTest: XCTestCase {
2020
let queue = DispatchQueue(label: "ConcurrencyHelpersTest", attributes: .concurrent)
2121

2222
override func setUpWithError() throws {
23-
try skipOnWindowsAsTestCurrentlyFails()
23+
try skipOnWindowsAsTestCurrentlyFailsDang()
2424
}
2525

2626
func testThreadSafeKeyValueStore() {

Tests/BasicsTests/Environment/EnvironmentTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import Basics
1616

1717
import XCTest
18-
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails()
18+
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFailsDang()
1919

2020
final class EnvironmentTests: XCTestCase {
2121
func test_init() {
@@ -103,7 +103,7 @@ final class EnvironmentTests: XCTestCase {
103103
/// Important: This test is inherently race-prone, if it is proven to be
104104
/// flaky, it should run in a singled threaded environment/removed entirely.
105105
func test_current() throws {
106-
try skipOnWindowsAsTestCurrentlyFails(because: "ProcessInfo.processInfo.environment[pathEnvVarName] return nil in the docker container")
106+
try skipOnWindowsAsTestCurrentlyFailsDang(because: "ProcessInfo.processInfo.environment[pathEnvVarName] return nil in the docker container")
107107

108108
#if os(Windows)
109109
let pathEnvVarName = "Path"

Tests/BasicsTests/FileSystem/PathTests.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct PathTests {
4949
}
5050

5151
@Test(
52-
.skipHostOS(.windows),
52+
// skipHostOS(.windows),
5353
arguments: [
5454
(path: "/ab//cd//ef", expected: (windows ? #"\ab\cd\ef"# : "/ab/cd/ef"), label: "repeated path seperators"), // skip on windows
5555
(path: "/ab///cd//ef", expected: (windows ? #"\ab\cd\ef"# : "/ab/cd/ef"), label: "repeated path seperators"), // skip on windows
@@ -97,7 +97,7 @@ struct PathTests {
9797
}
9898

9999
@Test(
100-
.skipHostOS(.windows),
100+
// skipHostOS(.windows),
101101
arguments: [
102102
(path: "/", expected: (windows ? #"\"# : "/")),
103103
(path: "/a", expected: (windows ? #"\"# : "/")),
@@ -113,7 +113,7 @@ struct PathTests {
113113
}
114114

115115
@Test(
116-
.skipHostOS(.windows),
116+
// skipHostOS(.windows),
117117
arguments: [
118118
(path: "/", expected: (windows ? #"\"# : "/")),
119119
(path: "/a", expected: "a"),
@@ -128,7 +128,7 @@ struct PathTests {
128128
}
129129

130130
@Test(
131-
.skipHostOS(.windows),
131+
// skipHostOS(.windows),
132132
arguments: [
133133
(path: "/", expected: (windows ? #"\"# : "/")),
134134
(path: "/a", expected: "a"),
@@ -167,7 +167,7 @@ struct PathTests {
167167
}
168168

169169
@Test(
170-
.skipHostOS(.windows),
170+
// skipHostOS(.windows),
171171
arguments: [
172172
(path: "/", expected: ["/"]),
173173
(path: "/.", expected: ["/"]),
@@ -244,7 +244,7 @@ struct PathTests {
244244
}
245245

246246
@Test(
247-
.skipHostOS(.windows)
247+
// skipHostOS(.windows)
248248
)
249249
func absolutePathValidation() throws {
250250
#expect(throws: Never.self) {
@@ -261,7 +261,7 @@ struct PathTests {
261261
}
262262

263263
@Test(
264-
.skipHostOS(.windows)
264+
// skipHostOS(.windows)
265265
)
266266
func comparison() {
267267
#expect(AbsolutePath("/") <= AbsolutePath("/"));
@@ -299,7 +299,7 @@ struct PathTests {
299299
}
300300

301301
@Test(
302-
.skipHostOS(.windows),
302+
// skipHostOS(.windows),
303303
arguments: [
304304
(path: "ab//cd//ef", expected: (windows ? #"ab\cd\ef"# : "ab/cd/ef"), label: "repeated path seperators"),
305305
(path: "ab//cd///ef", expected: (windows ? #"ab\cd\ef"# : "ab/cd/ef"), label: "repeated path seperators"),
@@ -354,7 +354,7 @@ struct PathTests {
354354
}
355355

356356
@Test(
357-
.skipHostOS(.windows),
357+
// skipHostOS(.windows),
358358
arguments: [
359359
(path: "ab/c//d/", expected: (windows ? #"ab\c"# : "ab/c")),
360360
(path: "../a", expected: ".."),
@@ -374,7 +374,7 @@ struct PathTests {
374374
}
375375

376376
@Test(
377-
.skipHostOS(.windows),
377+
// skipHostOS(.windows),
378378
arguments: [
379379
(path: "../..", expected: ".."),
380380
(path: "../a", expected: "a"),
@@ -394,7 +394,7 @@ struct PathTests {
394394
}
395395

396396
@Test(
397-
.skipHostOS(.windows),
397+
// skipHostOS(.windows),
398398
arguments: [
399399
(path: "../..", expected: ".."),
400400
(path: "../a", expected: "a"),
@@ -442,7 +442,7 @@ struct PathTests {
442442
}
443443

444444
@Test(
445-
.skipHostOS(.windows),
445+
// skipHostOS(.windows),
446446
arguments: [
447447
(path: "", expected: ["."]),
448448
(path: ".", expected: ["."]),
@@ -469,7 +469,7 @@ struct PathTests {
469469
}
470470

471471
@Test(
472-
.skipHostOS(.windows)
472+
// skipHostOS(.windows)
473473
)
474474
func relativePathValidation() throws {
475475
#expect(throws: Never.self) {
@@ -484,7 +484,7 @@ struct PathTests {
484484
}
485485

486486
@Test(
487-
.skipHostOS(.windows)
487+
// skipHostOS(.windows)
488488
)
489489
@available(*, deprecated)
490490
func concatenation() throws {
@@ -525,7 +525,7 @@ struct PathTests {
525525
}
526526

527527
@Test(
528-
.skipHostOS(.windows)
528+
// skipHostOS(.windows)
529529
)
530530
func relativePathFromAbsolutePaths() throws {
531531
#expect(AbsolutePath("/").relative(to: AbsolutePath("/")) == RelativePath("."));
@@ -538,7 +538,7 @@ struct PathTests {
538538
}
539539

540540
@Test(
541-
.skipHostOS(.windows)
541+
// skipHostOS(.windows)
542542
)
543543
func codable() throws {
544544
struct Foo: Codable, Equatable {

Tests/BasicsTests/FileSystem/VFSTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Testing
1717

1818
import struct TSCBasic.ByteString
1919

20-
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails
20+
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFailsDang
2121

2222
func testWithTemporaryDirectory(
2323
function: StaticString = #function,
@@ -39,7 +39,7 @@ func testWithTemporaryDirectory(
3939

4040
struct VFSTests {
4141
@Test(
42-
.skipHostOS(.windows)
42+
// .skipHostOS(.windows)
4343
)
4444
func localBasics() throws {
4545
// tiny PE binary from: https://archive.is/w01DO

Tests/BasicsTests/HTTPClientTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ final class HTTPClientTests: XCTestCase {
226226
}
227227

228228
func testExponentialBackoff() async throws {
229-
try skipOnWindowsAsTestCurrentlyFails()
229+
try skipOnWindowsAsTestCurrentlyFailsDang()
230230

231231
let counter = SendableBox(0)
232232
let lastCall = SendableBox<Date>()

Tests/BasicsTests/LegacyHTTPClientTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ final class LegacyHTTPClientTests: XCTestCase {
350350
}
351351

352352
func testExponentialBackoff() throws {
353-
try skipOnWindowsAsTestCurrentlyFails()
353+
try skipOnWindowsAsTestCurrentlyFailsDang()
354354

355355
let count = ThreadSafeBox<Int>(0)
356356
let lastCall = ThreadSafeBox<Date>()

Tests/BasicsTests/Serialization/SerializedJSONTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
@testable import Basics
1414
import XCTest
15-
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFails
15+
import _InternalTestSupport // for skipOnWindowsAsTestCurrentlyFailsDang
1616

1717
final class SerializedJSONTests: XCTestCase {
1818
func testPathInterpolation() throws {
19-
try skipOnWindowsAsTestCurrentlyFails()
19+
try skipOnWindowsAsTestCurrentlyFailsDang()
2020

2121
var path = try AbsolutePath(validating: #"/test\backslashes"#)
2222
var json: SerializedJSON = "\(path)"

Tests/BuildTests/BuildPlanTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2036,7 +2036,7 @@ class BuildPlanTestCase: BuildSystemProviderTestCase {
20362036
}
20372037

20382038
func test_symbolGraphExtract_arguments() async throws {
2039-
try skipOnWindowsAsTestCurrentlyFails()
2039+
try skipOnWindowsAsTestCurrentlyFailsDang()
20402040

20412041
// ModuleGraph:
20422042
// .
@@ -4691,7 +4691,7 @@ class BuildPlanTestCase: BuildSystemProviderTestCase {
46914691
}
46924692

46934693
func testUserToolchainCompileFlags() async throws {
4694-
try skipOnWindowsAsTestCurrentlyFails()
4694+
try skipOnWindowsAsTestCurrentlyFailsDang()
46954695

46964696
let fs = InMemoryFileSystem(
46974697
emptyFiles:
@@ -4945,7 +4945,7 @@ class BuildPlanTestCase: BuildSystemProviderTestCase {
49454945
}
49464946

49474947
func testUserToolchainWithToolsetCompileFlags() async throws {
4948-
try skipOnWindowsAsTestCurrentlyFails(because: "Path delimiters donw's work well on Windows")
4948+
try skipOnWindowsAsTestCurrentlyFailsDang(because: "Path delimiters donw's work well on Windows")
49494949

49504950
let fileSystem = InMemoryFileSystem(
49514951
emptyFiles:
@@ -5115,7 +5115,7 @@ class BuildPlanTestCase: BuildSystemProviderTestCase {
51155115
}
51165116

51175117
func testUserToolchainWithSDKSearchPaths() async throws {
5118-
try skipOnWindowsAsTestCurrentlyFails()
5118+
try skipOnWindowsAsTestCurrentlyFailsDang()
51195119

51205120
let fileSystem = InMemoryFileSystem(
51215121
emptyFiles:

Tests/BuildTests/BuildSystemDelegateTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class BuildSystemDelegateTests: XCTestCase {
3030
}
3131

3232
func testFilterNonFatalCodesignMessages() async throws {
33-
try skipOnWindowsAsTestCurrentlyFails()
33+
try skipOnWindowsAsTestCurrentlyFailsDang()
3434

3535
try XCTSkipIf(!UserToolchain.default.supportsSDKDependentTests(), "skipping because test environment doesn't support this test")
3636
// Note: we can re-use the `TestableExe` fixture here since we just need an executable.

Tests/BuildTests/LLBuildManifestBuilderTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ final class LLBuildManifestBuilderTests: XCTestCase {
195195

196196
/// Verifies that two modules with the same name but different triples don't share same build manifest keys.
197197
func testToolsBuildTriple() async throws {
198-
try skipOnWindowsAsTestCurrentlyFails()
198+
try skipOnWindowsAsTestCurrentlyFailsDang()
199199

200200
let (graph, fs, scope) = try macrosPackageGraph()
201201
let productsTriple = Triple.x86_64MacOS

Tests/BuildTests/PluginsBuildPlanTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import PackageModel
1818

1919
final class PluginsBuildPlanTests: XCTestCase {
2020
func testBuildToolsDatabasePath() async throws {
21-
try skipOnWindowsAsTestCurrentlyFails()
21+
try skipOnWindowsAsTestCurrentlyFailsDang()
2222

2323
try await fixture(name: "Miscellaneous/Plugins/MySourceGenPlugin") { fixturePath in
2424
let (stdout, _) = try await executeSwiftBuild(fixturePath)

Tests/BuildTests/PrepareForIndexTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import struct PackageModel.TargetDescription
2626

2727
class PrepareForIndexTests: XCTestCase {
2828
func testPrepare() async throws {
29-
try skipOnWindowsAsTestCurrentlyFails()
29+
try skipOnWindowsAsTestCurrentlyFailsDang()
3030

3131
let (graph, fs, scope) = try macrosPackageGraph()
3232

@@ -96,7 +96,7 @@ class PrepareForIndexTests: XCTestCase {
9696

9797
// enable-testing requires the non-exportable-decls, make sure they aren't skipped.
9898
func testEnableTesting() async throws {
99-
try skipOnWindowsAsTestCurrentlyFails()
99+
try skipOnWindowsAsTestCurrentlyFailsDang()
100100

101101
let fs = InMemoryFileSystem(
102102
emptyFiles:
@@ -167,7 +167,7 @@ class PrepareForIndexTests: XCTestCase {
167167
}
168168

169169
func testPrepareNoLazy() async throws {
170-
try skipOnWindowsAsTestCurrentlyFails()
170+
try skipOnWindowsAsTestCurrentlyFailsDang()
171171

172172
let (graph, fs, scope) = try macrosPackageGraph()
173173

Tests/PackageGraphPerformanceTests/PackageGraphPerfTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ final class PackageGraphPerfTests: XCTestCasePerf {
165165
}
166166

167167
func testRecursiveDependencies() throws {
168-
try skipOnWindowsAsTestCurrentlyFails()
168+
try skipOnWindowsAsTestCurrentlyFailsDang()
169169

170170
var resolvedTarget = ResolvedModule.mock(packageIdentity: "pkg", name: "t0")
171171
for i in 1..<1000 {

Tests/PackageGraphTests/ModulesGraphTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import struct TSCBasic.ByteString
2323

2424
final class ModulesGraphTests: XCTestCase {
2525
func testBasic() throws {
26-
try skipOnWindowsAsTestCurrentlyFails()
26+
try skipOnWindowsAsTestCurrentlyFailsDang()
2727
let fs = InMemoryFileSystem(
2828
emptyFiles:
2929
"/Foo/Sources/Foo/source.swift",

Tests/PackageLoadingTests/PackageBuilderTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ final class PackageBuilderTests: XCTestCase {
564564
}
565565

566566
func testTestManifestSearch() throws {
567-
try skipOnWindowsAsTestCurrentlyFails()
567+
try skipOnWindowsAsTestCurrentlyFailsDang()
568568

569569
let fs = InMemoryFileSystem(emptyFiles:
570570
"/pkg/foo.swift",

0 commit comments

Comments
 (0)