mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-27 10:56:28 +00:00
make run the default action of a test in tester
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user