make tests green; better output for when megatest execution fails

This commit is contained in:
Araq 2018-12-10 15:06:01 +01:00
commit 4d616b5dc4
6 changed files with 6 additions and 5 deletions

View file

@ -566,6 +566,7 @@ proc runJoinedTest(r: var TResults, cat: Category, testsDir: string) =
(buf, exitCode) = execCmdEx2("./megatest", [], {poStdErrToStdOut}, "") (buf, exitCode) = execCmdEx2("./megatest", [], {poStdErrToStdOut}, "")
if exitCode != 0: if exitCode != 0:
echo buf
quit("megatest execution failed") quit("megatest execution failed")
norm buf norm buf

View file

@ -244,7 +244,7 @@ template forwardPacketT*(typeName: untyped; underlyingType: untyped) {.dirty.} =
#writeData(s, addr p, sizeof(p)) #writeData(s, addr p, sizeof(p))
buffer.write(underlyingType(ord)) buffer.write(underlyingType(ord))
when true: when false:
type type
SomeEnum = enum SomeEnum = enum
A = 0'i8, A = 0'i8,

View file

@ -50,7 +50,7 @@ macro `?`(a: untyped): untyped =
result = ($a[1].ident)[0].lit result = ($a[1].ident)[0].lit
## echo(?F,?a,?t,?t,?y) ## echo(?F,?a,?t,?t,?y)
when true: when false:
macro foo(x: untyped) = macro foo(x: untyped) =
result = newNimNode(nnkStmtList) result = newNimNode(nnkStmtList)
result.add(newNimNode(nnkCall).und(!!"echo", "Hello thar".lit)) result.add(newNimNode(nnkCall).und(!!"echo", "Hello thar".lit))

View file

@ -106,7 +106,7 @@ proc readChar*(buffer: PBuffer): char {.inline.} = return readInt8(buffer).char
proc readBool*(buffer: PBuffer): bool {.inline.} = return readInt8(buffer).bool proc readBool*(buffer: PBuffer): bool {.inline.} = return readInt8(buffer).bool
when true: when false:
var b = newBuffer(100) var b = newBuffer(100)
var str = "hello there" var str = "hello there"
b.write str b.write str

View file

@ -17,7 +17,7 @@ template unless*(condition: untyped; body: untyped) {.dirty.} =
if not condition: if not condition:
body body
when true: when false:
proc dumpSeq[T](x: seq[T]) = proc dumpSeq[T](x: seq[T]) =
for index, item in x.pairs: for index, item in x.pairs:
echo index, " ", item echo index, " ", item

View file

@ -1,7 +1,7 @@
discard """ discard """
nimout: ''' nimout: '''
compile start compile start
tused.nim(15, 8) Hint: 'tused.echoSub(a: int, b: int)[declared in tused.nim(15, 7)]' is declared but not used [XDeclaredButNotUsed] tused.nim(17, 8) Hint: 'tused.echoSub(a: int, b: int)[declared in tused.nim(17, 7)]' is declared but not used [XDeclaredButNotUsed]
compile end''' compile end'''
output: "8\n8" output: "8\n8"
joinable: false joinable: false