test-runner for caas multi-step tests
This commit is contained in:
parent
ac9db5d684
commit
a8e12afc76
9 changed files with 122 additions and 4 deletions
|
|
@ -106,6 +106,12 @@ proc write*(s: PStream, x: string) =
|
|||
## terminating zero is written.
|
||||
writeData(s, cstring(x), x.len)
|
||||
|
||||
proc writeln*(s: PStream, args: varargs[string, `$`]) =
|
||||
## writes one or more strings to the the stream `s` followed
|
||||
## by a new line. No length field or terminating zero is written.
|
||||
for str in args: write(s, str)
|
||||
write(s, "\n")
|
||||
|
||||
proc read[T](s: PStream, result: var T) =
|
||||
## generic read procedure. Reads `result` from the stream `s`.
|
||||
if readData(s, addr(result), sizeof(T)) != sizeof(T):
|
||||
|
|
|
|||
|
|
@ -2407,8 +2407,8 @@ proc astToStr*[T](x: T): string {.magic: "AstToStr", noSideEffect.}
|
|||
## converts the AST of `x` into a string representation. This is very useful
|
||||
## for debugging.
|
||||
|
||||
proc InstantiationInfo*(index = -1): tuple[filename: string, line: int] {.
|
||||
magic: "InstantiationInfo", noSideEffect.}
|
||||
proc InstantiationInfo*(index = -1, fullPaths = false): tuple[
|
||||
filename: string, line: int] {. magic: "InstantiationInfo", noSideEffect.}
|
||||
## provides access to the compiler's instantiation stack line information.
|
||||
##
|
||||
## This proc is mostly useful for meta programming (eg. ``assert`` template)
|
||||
|
|
@ -2438,6 +2438,9 @@ proc InstantiationInfo*(index = -1): tuple[filename: string, line: int] {.
|
|||
## testException(EInvalidIndex, tester(1))
|
||||
## # --> Test failure at example.nim:20 with 'tester(1)'
|
||||
|
||||
template CurrentSourcePath*: string = InstantiationInfo(-1, true).filename
|
||||
## returns the full file-system path of the current source
|
||||
|
||||
proc raiseAssert*(msg: string) {.noinline.} =
|
||||
raise newException(EAssertionFailed, msg)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue