mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-14 23:33:28 +00:00
make tests green; better output for when megatest execution fails
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user