From 555cfd1d59e773e92a7158b7c3b5908017f1ddac Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Mon, 14 Dec 2020 02:37:27 -0800 Subject: [PATCH] fix #16330 tshould_not_work (#16342) --- testament/testament.nim | 4 ++-- tests/testament/tshould_not_work.nim | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/testament/testament.nim b/testament/testament.nim index a301b018c7..7b1a25bf08 100644 --- a/testament/testament.nim +++ b/testament/testament.nim @@ -144,7 +144,7 @@ proc prepareTestArgs(cmdTemplate, filename, options, nimcache: string, options.add " " & extraOptions result = parseCmdLine(cmdTemplate % ["target", targetToCmd[target], "options", options, "file", filename.quoteShell, - "filedir", filename.getFileDir()]) + "filedir", filename.getFileDir(), "nim", compilerPrefix]) proc callCompiler(cmdTemplate, filename, options, nimcache: string, target: TTarget, extraOptions = ""): TSpec = @@ -682,7 +682,7 @@ proc main() = gTargets = parseTargets(targetsStr) targetsSet = true of "nim": - compilerPrefix = addFileExt(p.val.string, ExeExt) + compilerPrefix = addFileExt(p.val.string.absolutePath, ExeExt) of "directory": setCurrentDir(p.val.string) of "colors": diff --git a/tests/testament/tshould_not_work.nim b/tests/testament/tshould_not_work.nim index a7a877fe85..a0b4d6a367 100644 --- a/tests/testament/tshould_not_work.nim +++ b/tests/testament/tshould_not_work.nim @@ -1,5 +1,5 @@ discard """ -cmd: "testament/testament --directory:testament --colors:off --backendLogging:off --nim:../compiler/nim category shouldfail" +cmd: "testament/testament --directory:testament --colors:off --backendLogging:off --nim:$nim category shouldfail" action: compile nimout: ''' FAIL: tests/shouldfail/tccodecheck.nim c @@ -35,5 +35,3 @@ FAIL: tests/shouldfail/tvalgrind.nim c Failure: reExitcodesDiffer ''' """ - -# xxx `--nim:../compiler/nim`, doesn't seem correct (and should also honor `testament --nim`)