make run the default action of a test in tester

This commit is contained in:
Arne Döring
2018-11-13 15:21:14 +01:00
committed by Araq
parent 610283b9b0
commit 031bfdec6f
50 changed files with 313 additions and 46 deletions

View File

@@ -531,6 +531,7 @@ proc processCategory(r: var TResults, cat: Category, options: string) =
else:
var testsRun = 0
for name in os.walkFiles("tests" & DirSep &.? cat.string / "t*.nim"):
echo name
testSpec r, makeTest(name, options, cat)
inc testsRun
if testsRun == 0:

View File

@@ -10,18 +10,18 @@
import parseutils, strutils, os, osproc, streams, parsecfg
var compilerPrefix* = "compiler" / "nim "
var compilerPrefix* = "compiler" / "nim"
let isTravis* = existsEnv("TRAVIS")
let isAppVeyor* = existsEnv("APPVEYOR")
proc cmdTemplate*(): string =
compilerPrefix & "$target --lib:lib --hints:on -d:testing --nimblePath:tests/deps $options $file"
compilerPrefix & " $target --lib:lib --hints:on -d:testing --nimblePath:tests/deps $options $file"
type
TTestAction* = enum
actionCompile = "compile"
actionRun = "run"
actionCompile = "compile"
actionReject = "reject"
actionRunNoSpec = "runNoSpec"
TResultEnum* = enum
@@ -186,7 +186,7 @@ proc parseSpec*(filename: string): TSpec =
raise newException(ValueError, "cannot interpret as a bool: " & e.value)
of "cmd":
if e.value.startsWith("nim "):
result.cmd = compilerPrefix & e.value[4..^1]
result.cmd = compilerPrefix & e.value[3..^1]
else:
result.cmd = e.value
of "ccodecheck": result.ccodeCheck = e.value

View File

@@ -469,7 +469,7 @@ proc main() =
of "targets":
targetsStr = p.val.string
targets = parseTargets(targetsStr)
of "nim": compilerPrefix = p.val.string & " "
of "nim": compilerPrefix = p.val.string
else: quit Usage
p.next()
if p.kind != cmdArgument: quit Usage