forked from nim-lang/Nim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert workarounds from nim-lang#16698 and add allowPrefixMatch optio…
…nal param to greedyOrderedSubsetLines
- Loading branch information
1 parent
2961df0
commit 87cd3c0
Showing
18 changed files
with
41 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
discard """ | ||
targets: "c" | ||
ccodecheck: "baz" | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
discard """ | ||
errormsg: "undeclared identifier: 'undeclared'" | ||
targets: "c" | ||
line: 9 | ||
column: 7 | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
discard """ | ||
errormsg: "wrong error message" | ||
targets: "c" | ||
line: 9 | ||
column: 6 | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
discard """ | ||
targets: "c" | ||
exitcode: 1 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
discard """ | ||
targets: "c" | ||
errormsg: "undeclared identifier: 'undefined'" | ||
file: "notthisfile.nim" | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
discard """ | ||
targets: "c" | ||
errormsg: "undeclared identifier: 'undeclared'" | ||
line: 10 | ||
column: 6 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
discard """ | ||
targets: "c" | ||
maxcodesize: 1 | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
discard """ | ||
targets: "c" | ||
nimout: "Hello World!" | ||
action: compile | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
discard """ | ||
targets: "c" | ||
nimout: ''' | ||
msg1 | ||
msg2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
discard """ | ||
targets: "c" | ||
output: ''' | ||
done | ||
''' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
discard """ | ||
outputsub: "something else" | ||
targets: "c" | ||
""" | ||
|
||
echo "Hello World!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
discard """ | ||
sortoutput: true | ||
targets: "c" | ||
output: ''' | ||
2 | ||
1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
discard """ | ||
timeout: "0.1" | ||
targets: "c" | ||
""" | ||
|
||
import os | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
discard """ | ||
valgrind: true | ||
targets: "c" | ||
cmd: "nim $target --gc:arc -d:useMalloc $options $file" | ||
""" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,50 @@ | ||
discard """ | ||
cmd: "testament/testament --directory:testament --colors:off --backendLogging:off --nim:$nim category shouldfail" | ||
action: compile | ||
nimout: ''' | ||
FAIL: tests/shouldfail/tccodecheck.nim c | ||
const expected = """ | ||
FAIL: tests/shouldfail/tccodecheck.nim | ||
Failure: reCodegenFailure | ||
Expected: | ||
baz | ||
FAIL: tests/shouldfail/tcolumn.nim c | ||
FAIL: tests/shouldfail/tcolumn.nim | ||
Failure: reLinesDiffer | ||
FAIL: tests/shouldfail/terrormsg.nim c | ||
FAIL: tests/shouldfail/terrormsg.nim | ||
Failure: reMsgsDiffer | ||
FAIL: tests/shouldfail/texitcode1.nim c | ||
FAIL: tests/shouldfail/texitcode1.nim | ||
Failure: reExitcodesDiffer | ||
FAIL: tests/shouldfail/tfile.nim c | ||
FAIL: tests/shouldfail/tfile.nim | ||
Failure: reFilesDiffer | ||
FAIL: tests/shouldfail/tline.nim c | ||
FAIL: tests/shouldfail/tline.nim | ||
Failure: reLinesDiffer | ||
FAIL: tests/shouldfail/tmaxcodesize.nim c | ||
FAIL: tests/shouldfail/tmaxcodesize.nim | ||
Failure: reCodegenFailure | ||
max allowed size: 1 | ||
FAIL: tests/shouldfail/tnimout.nim c | ||
FAIL: tests/shouldfail/tnimout.nim | ||
Failure: reMsgsDiffer | ||
FAIL: tests/shouldfail/tnimoutfull.nim c | ||
FAIL: tests/shouldfail/tnimoutfull.nim | ||
Failure: reMsgsDiffer | ||
FAIL: tests/shouldfail/toutput.nim c | ||
FAIL: tests/shouldfail/toutput.nim | ||
Failure: reOutputsDiffer | ||
FAIL: tests/shouldfail/toutputsub.nim c | ||
FAIL: tests/shouldfail/toutputsub.nim | ||
Failure: reOutputsDiffer | ||
FAIL: tests/shouldfail/treject.nim c | ||
FAIL: tests/shouldfail/treject.nim | ||
Failure: reFilesDiffer | ||
FAIL: tests/shouldfail/tsortoutput.nim c | ||
FAIL: tests/shouldfail/tsortoutput.nim | ||
Failure: reOutputsDiffer | ||
FAIL: tests/shouldfail/ttimeout.nim c | ||
FAIL: tests/shouldfail/ttimeout.nim | ||
Failure: reTimeout | ||
FAIL: tests/shouldfail/tvalgrind.nim c | ||
FAIL: tests/shouldfail/tvalgrind.nim | ||
Failure: reExitcodesDiffer | ||
''' | ||
""" | ||
|
||
import std/[os,strformat,osproc] | ||
import stdtest/testutils | ||
|
||
proc main = | ||
const nim = getCurrentCompilerExe() | ||
# TODO: bin/testament instead? like other tools (eg bin/nim, bin/nimsuggest etc) | ||
let testamentExe = "testament/testament" | ||
let cmd = fmt"{testamentExe} --directory:testament --colors:off --backendLogging:off --nim:{nim} category shouldfail" | ||
let (outp, status) = execCmdEx(cmd) | ||
doAssert status == 1, $status | ||
|
||
let ok = greedyOrderedSubsetLines(expected, outp, allowPrefixMatch = true) | ||
doAssert ok, &"\nexpected:\n{expected}\noutp:\n{outp}" | ||
main() |