Tester tests (#9787)
* remove --lib:lib * added some tests for testatment * tests are addad WIP: add colors switch to tester * meta tester is integrated
This commit is contained in:
parent
8990764709
commit
cc0364e72f
15 changed files with 164 additions and 21 deletions
8
testament/tests/shouldfail/tccodecheck.nim
Normal file
8
testament/tests/shouldfail/tccodecheck.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
discard """
|
||||
ccodecheck: "baz"
|
||||
"""
|
||||
|
||||
proc foo(): void {.exportc: "bar".}=
|
||||
echo "Hello World"
|
||||
|
||||
foo()
|
||||
8
testament/tests/shouldfail/tcolumn.nim
Normal file
8
testament/tests/shouldfail/tcolumn.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
discard """
|
||||
line: 8
|
||||
column: 7
|
||||
errormsg: "undeclared identifier: 'undeclared'"
|
||||
"""
|
||||
|
||||
# test should fail because the line directive is wrong
|
||||
echo undeclared
|
||||
8
testament/tests/shouldfail/terrormsg.nim
Normal file
8
testament/tests/shouldfail/terrormsg.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
discard """
|
||||
line: 8
|
||||
column: 6
|
||||
errormsg: "wrong error message"
|
||||
"""
|
||||
|
||||
# test should fail because the line directive is wrong
|
||||
echo undeclared
|
||||
3
testament/tests/shouldfail/texitcode1.nim
Normal file
3
testament/tests/shouldfail/texitcode1.nim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
discard """
|
||||
exitcode: 1
|
||||
"""
|
||||
6
testament/tests/shouldfail/tfile.nim
Normal file
6
testament/tests/shouldfail/tfile.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
discard """
|
||||
file: "notthisfile.nim"
|
||||
errmsg: "undeclared identifier: 'undefined'"
|
||||
"""
|
||||
|
||||
echo undefined
|
||||
8
testament/tests/shouldfail/tline.nim
Normal file
8
testament/tests/shouldfail/tline.nim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
discard """
|
||||
line: 9
|
||||
column: 6
|
||||
errormsg: "undeclared identifier: 'undeclared'"
|
||||
"""
|
||||
|
||||
# test should fail because the line directive is wrong
|
||||
echo undeclared
|
||||
5
testament/tests/shouldfail/tmaxcodesize.nim
Normal file
5
testament/tests/shouldfail/tmaxcodesize.nim
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
discard """
|
||||
maxcodesize: 1
|
||||
"""
|
||||
|
||||
echo "Hello World"
|
||||
6
testament/tests/shouldfail/tmsg.nim
Normal file
6
testament/tests/shouldfail/tmsg.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
discard """
|
||||
msg: "Hello World"
|
||||
"""
|
||||
|
||||
static:
|
||||
echo "something else"
|
||||
7
testament/tests/shouldfail/tnimout.nim
Normal file
7
testament/tests/shouldfail/tnimout.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
discard """
|
||||
nimout: "Hello World!"
|
||||
action: compile
|
||||
"""
|
||||
|
||||
static:
|
||||
echo "something else"
|
||||
7
testament/tests/shouldfail/toutput.nim
Normal file
7
testament/tests/shouldfail/toutput.nim
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
discard """
|
||||
output: '''
|
||||
done
|
||||
'''
|
||||
"""
|
||||
|
||||
echo "broken"
|
||||
5
testament/tests/shouldfail/toutputsub.nim
Normal file
5
testament/tests/shouldfail/toutputsub.nim
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
discard """
|
||||
outputsub: "something else"
|
||||
"""
|
||||
|
||||
echo "Hello World!"
|
||||
11
testament/tests/shouldfail/tsortoutput.nim
Normal file
11
testament/tests/shouldfail/tsortoutput.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
discard """
|
||||
sortoutput: true
|
||||
output: '''
|
||||
2
|
||||
1
|
||||
'''
|
||||
"""
|
||||
|
||||
# this test should ensure that the output is actually sorted
|
||||
echo "2"
|
||||
echo "1"
|
||||
Loading…
Add table
Add a link
Reference in a new issue