Skip to content

Commit 9f38bec

Browse files
weissikevints
authored andcommitted
fix tests dying because of SIGPIPE
(`POSIX` sends `SIGPIPE` when writing to a closed fd)
1 parent af5dae5 commit 9f38bec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

TestFoundation/main.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@
1010
#if DEPLOYMENT_RUNTIME_OBJC || os(Linux)
1111
import Foundation
1212
import XCTest
13+
import Glibc
1314
#else
1415
import SwiftFoundation
1516
import SwiftXCTest
17+
import Darwin
1618
#endif
1719

1820
internal func testBundle() -> Bundle {
1921
return Bundle.main
2022
}
2123

24+
// ignore SIGPIPE which is sent when writing to closed file descriptors.
25+
_ = signal(SIGPIPE, SIG_IGN)
26+
2227
// For the Swift version of the Foundation tests, we must manually list all test cases here.
2328
XCTMain([
2429
testCase(TestNSAffineTransform.allTests),

0 commit comments

Comments
 (0)