Skip to content

Commit

Permalink
Put --dir wasmtime option before the test file path (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun authored Jun 21, 2024
1 parent dca59f3 commit 3e08f7d
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ struct CommandTestRunner: TestRunner {
func run() async throws {
let program = try ProcessInfo.processInfo.environment["CARTON_TEST_RUNNER"] ?? defaultWASIRuntime()
terminal.write("\nRunning the test bundle with \"\(program)\":\n", inColor: .yellow)
var arguments = [program, testFilePath.pathString]

var arguments = [program]
var xctestArgs: [String] = []
if listTestCases {
arguments.append(contentsOf: ["--", "-l"])
xctestArgs.append(contentsOf: ["--", "-l"])
} else {
let programName = (program as NSString).lastPathComponent
let programName = URL(fileURLWithPath: program).lastPathComponent
if programName == "wasmtime" {
arguments += ["--dir", "."]
}

if !testCases.isEmpty {
arguments.append("--")
arguments.append(contentsOf: testCases)
xctestArgs.append("--")
xctestArgs.append(contentsOf: testCases)
}
}
arguments += [testFilePath.pathString] + xctestArgs
try await Process.run(arguments, parser: TestsParser(), terminal)
}

Expand Down

0 comments on commit 3e08f7d

Please sign in to comment.