make tests green; better output for when megatest execution fails
This commit is contained in:
parent
0d99ff6113
commit
4d616b5dc4
6 changed files with 6 additions and 5 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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))
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue