fix #17732(forward args... to megatest) (#17780)

This commit is contained in:
flywind 2021-04-19 17:48:26 +08:00 • committed by GitHub
commit bae7b5b779
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]