summary refs log tree commit diff stats
path: root/testament/tests
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2018-11-27 10:00:32 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-11-27 10:00:32 +0100
commitcc0364e72f14531466eec367f10f72e4bcd9168e (patch)
tree0e8bcfd402f6ca02f57a624feb7a00bfaccee00d /testament/tests
parent89907647090390d846dbfc3e31b19dd6deac746e (diff)
downloadNim-cc0364e72f14531466eec367f10f72e4bcd9168e.tar.gz
Tester tests (#9787)
* remove --lib:lib
* added some tests for testatment
* tests are addad WIP: add colors switch to tester
* meta tester is integrated
Diffstat (limited to 'testament/tests')
-rw-r--r--testament/tests/shouldfail/tccodecheck.nim8
-rw-r--r--testament/tests/shouldfail/tcolumn.nim8
-rw-r--r--testament/tests/shouldfail/terrormsg.nim8
-rw-r--r--testament/tests/shouldfail/texitcode1.nim3
-rw-r--r--testament/tests/shouldfail/tfile.nim6
-rw-r--r--testament/tests/shouldfail/tline.nim8
-rw-r--r--testament/tests/shouldfail/tmaxcodesize.nim5
-rw-r--r--testament/tests/shouldfail/tmsg.nim6
-rw-r--r--testament/tests/shouldfail/tnimout.nim7
-rw-r--r--testament/tests/shouldfail/toutput.nim7
-rw-r--r--testament/tests/shouldfail/toutputsub.nim5
-rw-r--r--testament/tests/shouldfail/tsortoutput.nim11
12 files changed, 82 insertions, 0 deletions
diff --git a/testament/tests/shouldfail/tccodecheck.nim b/testament/tests/shouldfail/tccodecheck.nim
new file mode 100644
index 000000000..a8d216a5b
--- /dev/null
+++ b/testament/tests/shouldfail/tccodecheck.nim
@@ -0,0 +1,8 @@
+discard """
+ccodecheck: "baz"
+"""
+
+proc foo(): void {.exportc: "bar".}=
+  echo "Hello World"
+
+foo()
diff --git a/testament/tests/shouldfail/tcolumn.nim b/testament/tests/shouldfail/tcolumn.nim
new file mode 100644
index 000000000..f4046d58d
--- /dev/null
+++ b/testament/tests/shouldfail/tcolumn.nim
@@ -0,0 +1,8 @@
+discard """
+line: 8
+column: 7
+errormsg: "undeclared identifier: 'undeclared'"
+"""
+
+# test should fail because the line directive is wrong
+echo undeclared
diff --git a/testament/tests/shouldfail/terrormsg.nim b/testament/tests/shouldfail/terrormsg.nim
new file mode 100644
index 000000000..61c08d93d
--- /dev/null
+++ b/testament/tests/shouldfail/terrormsg.nim
@@ -0,0 +1,8 @@
+discard """
+line: 8
+column: 6
+errormsg: "wrong error message"
+"""
+
+# test should fail because the line directive is wrong
+echo undeclared
diff --git a/testament/tests/shouldfail/texitcode1.nim b/testament/tests/shouldfail/texitcode1.nim
new file mode 100644
index 000000000..1b38b4f2e
--- /dev/null
+++ b/testament/tests/shouldfail/texitcode1.nim
@@ -0,0 +1,3 @@
+discard """
+exitcode: 1
+"""
diff --git a/testament/tests/shouldfail/tfile.nim b/testament/tests/shouldfail/tfile.nim
new file mode 100644
index 000000000..07a526c68
--- /dev/null
+++ b/testament/tests/shouldfail/tfile.nim
@@ -0,0 +1,6 @@
+discard """
+file: "notthisfile.nim"
+errmsg: "undeclared identifier: 'undefined'"
+"""
+
+echo undefined
diff --git a/testament/tests/shouldfail/tline.nim b/testament/tests/shouldfail/tline.nim
new file mode 100644
index 000000000..963e44fc7
--- /dev/null
+++ b/testament/tests/shouldfail/tline.nim
@@ -0,0 +1,8 @@
+discard """
+line: 9
+column: 6
+errormsg: "undeclared identifier: 'undeclared'"
+"""
+
+# test should fail because the line directive is wrong
+echo undeclared
diff --git a/testament/tests/shouldfail/tmaxcodesize.nim b/testament/tests/shouldfail/tmaxcodesize.nim
new file mode 100644
index 000000000..9879e4181
--- /dev/null
+++ b/testament/tests/shouldfail/tmaxcodesize.nim
@@ -0,0 +1,5 @@
+discard """
+maxcodesize: 1
+"""
+
+echo "Hello World"
diff --git a/testament/tests/shouldfail/tmsg.nim b/testament/tests/shouldfail/tmsg.nim
new file mode 100644
index 000000000..4ad17fa95
--- /dev/null
+++ b/testament/tests/shouldfail/tmsg.nim
@@ -0,0 +1,6 @@
+discard """
+msg: "Hello World"
+"""
+
+static:
+  echo "something else"
diff --git a/testament/tests/shouldfail/tnimout.nim b/testament/tests/shouldfail/tnimout.nim
new file mode 100644
index 000000000..c0e332053
--- /dev/null
+++ b/testament/tests/shouldfail/tnimout.nim
@@ -0,0 +1,7 @@
+discard """
+nimout: "Hello World!"
+action: compile
+"""
+
+static:
+  echo "something else"
diff --git a/testament/tests/shouldfail/toutput.nim b/testament/tests/shouldfail/toutput.nim
new file mode 100644
index 000000000..ac0bc7a46
--- /dev/null
+++ b/testament/tests/shouldfail/toutput.nim
@@ -0,0 +1,7 @@
+discard """
+output: '''
+done
+'''
+"""
+
+echo "broken"
diff --git a/testament/tests/shouldfail/toutputsub.nim b/testament/tests/shouldfail/toutputsub.nim
new file mode 100644
index 000000000..7cc51ee8d
--- /dev/null
+++ b/testament/tests/shouldfail/toutputsub.nim
@@ -0,0 +1,5 @@
+discard """
+outputsub: "something else"
+"""
+
+echo "Hello World!"
diff --git a/testament/tests/shouldfail/tsortoutput.nim b/testament/tests/shouldfail/tsortoutput.nim
new file mode 100644
index 000000000..4ce9ce26d
--- /dev/null
+++ b/testament/tests/shouldfail/tsortoutput.nim
@@ -0,0 +1,11 @@
+discard """
+sortoutput: true
+output: '''
+2
+1
+'''
+"""
+
+# this test should ensure that the output is actually sorted
+echo "2"
+echo "1"