make tests green; better output for when megatest execution fails

This commit is contained in:
Araq
2018-12-10 15:06:01 +01:00
parent 0d99ff6113
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}, "")
if exitCode != 0:
echo buf
quit("megatest execution failed")
norm buf

View File

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

View File

@@ -50,7 +50,7 @@ macro `?`(a: untyped): untyped =
result = ($a[1].ident)[0].lit
## echo(?F,?a,?t,?t,?y)
when true:
when false:
macro foo(x: untyped) =
result = newNimNode(nnkStmtList)
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
when true:
when false:
var b = newBuffer(100)
var str = "hello there"
b.write str

View File

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

View File

@@ -1,7 +1,7 @@
discard """
nimout: '''
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'''
output: "8\n8"
joinable: false