Skip to content

Commit 7c112c3

Browse files
StdlibUnittest: force in-process exec for limited platforms
1 parent 4ab646d commit 7c112c3

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

stdlib/private/StdlibUnittest/StdlibUnittest.swift

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ import WinSDK
3535
import ObjectiveC
3636
#endif
3737

38+
#if os(WASI)
39+
let platformSupportSpawnChild = false
40+
#else
41+
let platformSupportSpawnChild = true
42+
#endif
43+
3844
extension String {
3945
/// Returns the lines in `self`.
4046
public var _lines : [String] {
@@ -1690,12 +1696,7 @@ public func runAllTests() {
16901696
if _isChildProcess {
16911697
_childProcess()
16921698
} else {
1693-
#if os(WASI)
1694-
// WASI doesn't support child process
1695-
var runTestsInProcess: Bool = true
1696-
#else
1697-
var runTestsInProcess: Bool = false
1698-
#endif
1699+
var runTestsInProcess: Bool = !platformSupportSpawnChild
16991700
var filter: String?
17001701
var args = [String]()
17011702
var i = 0
@@ -1765,7 +1766,7 @@ public func runAllTestsAsync() async {
17651766
if _isChildProcess {
17661767
await _childProcessAsync()
17671768
} else {
1768-
var runTestsInProcess: Bool = false
1769+
var runTestsInProcess: Bool = !platformSupportSpawnChild
17691770
var filter: String?
17701771
var args = [String]()
17711772
var i = 0

0 commit comments

Comments
 (0)