test-runner for caas multi-step tests

This commit is contained in:
Zahary Karadjov 2013-05-04 01:04:02 +03:00
commit a8e12afc76
9 changed files with 122 additions and 4 deletions

View file

@ -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):