run the new testrunner on 'nimble test'

This commit is contained in:
Zahary Karadjov 2018-10-19 18:22:46 +03:00
parent 8b9e508a0f
commit 94e8e2b2e8
2 changed files with 2 additions and 39 deletions

View File

@ -9,13 +9,7 @@ skipDirs = @["tests"]
requires "nim >= 0.18.1" requires "nim >= 0.18.1"
proc configForTests() =
--hints: off
--debuginfo
--path: "."
--run
task test, "run CPU tests": task test, "run CPU tests":
configForTests() cd "tests"
setCommand "c", "tests/all.nim" exec "nim c -r testrunner ."

View File

@ -1,31 +0,0 @@
import chronicles, strutils, unittest
type TestOutput = object
# XXX would be nicer to use something akin to a mock to verify this but 30s of
# searching didn't reveal anything
var v: string
customLogStream s[TextLineRecord[TestOutput, NoTimestamps, NoColors]]
template append*(o: var TestOutput, s: string) = v.add(s)
template flushOutput*(o: var TestOutput) = discard
suite "textlines":
setup:
v = ""
test "should quote space":
s.debug "test", yes = "quote me", no = "noquote"
check "yes=\"quote me\"" in v
check "no=noquote" in v
test "should escape newlines space lines":
const multiline = """quote
me"""
s.debug "test", s = multiline
check "s=\"quote\\nme\"" in v