Skip to content

Commit 58a9c90

Browse files
committed
Disable some tests for which dependencies are not available in Windows
1 parent e618e0f commit 58a9c90

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

Tests/TSCBasicTests/ProcessSetTests.swift

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

1717
class ProcessSetTests: XCTestCase {
18+
#if !os(Windows) // Signals are not supported in Windows
1819
func script(_ name: String) -> String {
1920
return AbsolutePath(#file).parentDirectory.appending(components: "processInputs", name).pathString
2021
}
@@ -75,4 +76,5 @@ class ProcessSetTests: XCTestCase {
7576

7677
t.join()
7778
}
79+
#endif
7880
}

Tests/TSCBasicTests/ProcessTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ class ProcessTests: XCTestCase {
113113
}
114114
}
115115

116+
#if !os(Windows) // Signals are not supported in Windows
116117
func testSignals() throws {
117118

118119
// Test sigint terminates the script.
@@ -161,6 +162,7 @@ class ProcessTests: XCTestCase {
161162
XCTAssertFalse(try Process.running(ProcessID(child), orDefunct: true))
162163
}
163164
}
165+
#endif
164166

165167
func testThreadSafetyOnWaitUntilExit() throws {
166168
let process = Process(args: "echo", "hello")

Tests/TSCBasicTests/TerminalControllerTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import TSCLibc
1414
import TSCBasic
1515

1616
final class TerminalControllerTests: XCTestCase {
17+
#if !os(Windows) // PseudoTerminal is not supported in Windows
1718
func testBasic() {
1819
guard let pty = PseudoTerminal(), let term = TerminalController(stream: pty.outStream) else {
1920
XCTFail("Couldn't create pseudo terminal.")
@@ -44,4 +45,5 @@ final class TerminalControllerTests: XCTestCase {
4445
XCTAssertEqual(wrapped, "\u{001B}[32mgreen\u{001B}[0m")
4546
pty.close()
4647
}
48+
#endif
4749
}

Tests/TSCUtilityTests/ProgressAnimationTests.swift

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,6 @@ final class ProgressAnimationTests: XCTestCase {
4040
XCTAssertEqual(outStream.bytes.validDescription, "")
4141
}
4242

43-
func testPercentProgressAnimationTTY() throws {
44-
let output = try readingTTY { tty in
45-
let animation = PercentProgressAnimation(stream: tty.outStream, header: "TestHeader")
46-
runProgressAnimation(animation)
47-
}
48-
49-
let startCyan = "\u{1B}[36m"
50-
let bold = "\u{1B}[1m"
51-
let end = "\u{1B}[0m"
52-
XCTAssertMatch(output.spm_chuzzle(), .prefix("\(startCyan)\(bold)TestHeader\(end)"))
53-
}
54-
5543
func testNinjaProgressAnimationDumbTerminal() {
5644
var outStream = BufferedOutputByteStream()
5745
var animation = NinjaProgressAnimation(stream: outStream)
@@ -74,6 +62,19 @@ final class ProgressAnimationTests: XCTestCase {
7462
XCTAssertEqual(outStream.bytes.validDescription, "")
7563
}
7664

65+
#if !os(Windows) // PseudoTerminal is not supported in Windows
66+
func testPercentProgressAnimationTTY() throws {
67+
let output = try readingTTY { tty in
68+
let animation = PercentProgressAnimation(stream: tty.outStream, header: "TestHeader")
69+
runProgressAnimation(animation)
70+
}
71+
72+
let startCyan = "\u{1B}[36m"
73+
let bold = "\u{1B}[1m"
74+
let end = "\u{1B}[0m"
75+
XCTAssertMatch(output.spm_chuzzle(), .prefix("\(startCyan)\(bold)TestHeader\(end)"))
76+
}
77+
7778
func testNinjaProgressAnimationTTY() throws {
7879
var output = try readingTTY { tty in
7980
let animation = NinjaProgressAnimation(stream: tty.outStream)
@@ -122,6 +123,7 @@ final class ProgressAnimationTests: XCTestCase {
122123

123124
return output
124125
}
126+
#endif
125127

126128
private func runProgressAnimation(_ animation: ProgressAnimationProtocol) {
127129
for i in 0...5 {

0 commit comments

Comments
 (0)