Skip to content

Free fork of NotProton: Windows Steam games in Mac Steam, on CodeWeavers' Wine and Apple's Game Porting Toolkit

Run the app tests serially and report uncollected output

NotProtonNot9d8452c44017
diff --git a/Makefile b/Makefile
index 99ec16b..6e9436e 100644
--- a/Makefile
+++ b/Makefile
@@ -230,7 +230,7 @@ APP_TESTS := app/Tests
app-tests:
@if [ ! -d $(APP_TESTS) ]; then $(call SKIP,app-tests,$(APP_TESTS)); exit 0; fi; \
- touch app/Package.swift; cd app && swift test
+ touch app/Package.swift; cd app && swift test --no-parallel
PANEL_TESTS := dylib/tests/panel-behavior
diff --git a/app/Tests/NotProtonAppTests/AppInfoToolTests.swift b/app/Tests/NotProtonAppTests/AppInfoToolTests.swift
index 3a6d356..34d09f2 100644
--- a/app/Tests/NotProtonAppTests/AppInfoToolTests.swift
+++ b/app/Tests/NotProtonAppTests/AppInfoToolTests.swift
@@ -101,7 +101,12 @@ struct AppInfoToolTests {
let path = URL.temporaryDirectory.appending(path: "np-appinfo-\(UUID().uuidString).vdf")
try cache.write(to: path)
defer { try? FileManager.default.removeItem(at: path) }
- return try Shell.run(tool.path(percentEncoded: false), [path.path(percentEncoded: false), appID])
+ let result = try Shell.run(
+ tool.path(percentEncoded: false), [path.path(percentEncoded: false), appID])
+ #expect(
+ !result.outputLost,
+ "appinfo ran but its output was never collected, so every field below reads as absent")
+ return result
}
private func values(_ result: CommandResult) -> [String: String] {
diff --git a/app/Tests/NotProtonAppTests/ShellTests.swift b/app/Tests/NotProtonAppTests/ShellTests.swift
index bb8bf6c..5105425 100644
--- a/app/Tests/NotProtonAppTests/ShellTests.swift
+++ b/app/Tests/NotProtonAppTests/ShellTests.swift
@@ -28,6 +28,7 @@ struct ShellTests {
let result = try Shell.run("/bin/cat", [file.path(percentEncoded: false)])
+ #expect(!result.outputLost, "the output was never collected, so the count below reads as zero")
#expect(result.succeeded)
#expect(result.stdout.utf8.count == payload.count)
}
@@ -44,6 +45,7 @@ struct ShellTests {
func separatesStderrFromStdout() throws {
let result = try Shell.run("/bin/cat", [absentPath()])
+ #expect(!result.outputLost, "the output was never collected, so both streams read as empty")
#expect(!result.succeeded)
#expect(result.stdout.isEmpty)
#expect(result.stderr.contains("No such file"))