koch: use in-tree Nim to run test if possible (#15018)

Fixes #15013
This commit is contained in:
alaviss
2020-07-20 06:02:48 +00:00
committed by GitHub
parent 71dd5f85b9
commit 9a76398ec6

View File

@@ -440,8 +440,10 @@ template `|`(a, b): string = (if a.len > 0: a else: b)
proc tests(args: string) =
nimexec "cc --opt:speed testament/testament"
let tester = quoteShell(getCurrentDir() / "testament/testament".exe)
let success = tryExec tester & " " & (args|"all")
var testCmd = quoteShell(getCurrentDir() / "testament/testament".exe)
testCmd.add " " & quoteShell("--nim:" & findNim())
testCmd.add " " & (args|"all")
let success = tryExec testCmd
if not success:
quit("tests failed", QuitFailure)