summary refs log tree commit diff stats
path: root/testament
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-04-19 17:48:26 +0800
committerGitHub <noreply@github.com>2021-04-19 11:48:26 +0200
commitbae7b5b7795ae8b429e50deba61430ae43a1750f (patch)
treebdb3991d2179418e152475c1bd6ae44c20df87a6 /testament
parent4b0b536419a500dc2e5a987ed9c2a374e0848008 (diff)
downloadNim-bae7b5b7795ae8b429e50deba61430ae43a1750f.tar.gz
fix #17732(forward args... to megatest) (#17780)
Diffstat (limited to 'testament')
-rw-r--r--testament/categories.nim10
1 files changed, 7 insertions, 3 deletions
diff --git a/testament/categories.nim b/testament/categories.nim
index 7b57adb8a..4c3a0b1f5 100644
--- a/testament/categories.nim
+++ b/testament/categories.nim
@@ -573,7 +573,7 @@ proc quoted(a: string): string =
   # todo: consider moving to system.nim
   result.addQuoted(a)
 
-proc runJoinedTest(r: var TResults, cat: Category, testsDir: string) =
+proc runJoinedTest(r: var TResults, cat: Category, testsDir: string, options: string) =
   ## returns a list of tests that have problems
   #[
   xxx create a reusable megatest API after abstracting out testament specific code,
@@ -619,7 +619,11 @@ proc runJoinedTest(r: var TResults, cat: Category, testsDir: string) =
   writeFile(megatestFile, megatest)
 
   let root = getCurrentDir()
-  let args = ["c", "--nimCache:" & outDir, "-d:testing", "-d:nimMegatest", "--listCmd", "--path:" & root, megatestFile]
+
+  var args = @["c", "--nimCache:" & outDir, "-d:testing", "-d:nimMegatest", "--listCmd",
+              "--path:" & root]
+  args.add options.parseCmdLine
+  args.add megatestFile
   var (cmdLine, buf, exitCode) = execCmdEx2(command = compilerPrefix, args = args, input = "")
   if exitCode != 0:
     echo "$ " & cmdLine & "\n" & buf
@@ -710,7 +714,7 @@ proc processCategory(r: var TResults, cat: Category,
   if not handled:
     case cat2
     of "megatest":
-      runJoinedTest(r, cat, testsDir)
+      runJoinedTest(r, cat, testsDir, options)
     else:
       var testsRun = 0
       var files: seq[string]