From 4d616b5dc4ee62698d16b5227c436a4edf2e9055 Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 10 Dec 2018 15:06:01 +0100 Subject: [PATCH] make tests green; better output for when megatest execution fails --- testament/categories.nim | 1 + .../keineschweine/dependencies/genpacket/genpacket_enet.nim | 2 +- .../manyloc/keineschweine/dependencies/genpacket/macro_dsl.nim | 2 +- tests/manyloc/keineschweine/lib/estreams.nim | 2 +- tests/manyloc/keineschweine/lib/map_filter.nim | 2 +- tests/pragmas/tused.nim | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/testament/categories.nim b/testament/categories.nim index 6e27898683..568a134407 100644 --- a/testament/categories.nim +++ b/testament/categories.nim @@ -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 diff --git a/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim b/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim index 5d844cff96..b36b49823e 100644 --- a/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim +++ b/tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim @@ -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, diff --git a/tests/manyloc/keineschweine/dependencies/genpacket/macro_dsl.nim b/tests/manyloc/keineschweine/dependencies/genpacket/macro_dsl.nim index a9e1e4dbb0..3341f42c21 100644 --- a/tests/manyloc/keineschweine/dependencies/genpacket/macro_dsl.nim +++ b/tests/manyloc/keineschweine/dependencies/genpacket/macro_dsl.nim @@ -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)) diff --git a/tests/manyloc/keineschweine/lib/estreams.nim b/tests/manyloc/keineschweine/lib/estreams.nim index 43a6d70043..99cbb63d18 100644 --- a/tests/manyloc/keineschweine/lib/estreams.nim +++ b/tests/manyloc/keineschweine/lib/estreams.nim @@ -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 diff --git a/tests/manyloc/keineschweine/lib/map_filter.nim b/tests/manyloc/keineschweine/lib/map_filter.nim index e129300662..acb58c60ee 100644 --- a/tests/manyloc/keineschweine/lib/map_filter.nim +++ b/tests/manyloc/keineschweine/lib/map_filter.nim @@ -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 diff --git a/tests/pragmas/tused.nim b/tests/pragmas/tused.nim index 67a039d8a4..7616c1215d 100644 --- a/tests/pragmas/tused.nim +++ b/tests/pragmas/tused.nim @@ -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