summary refs log tree commit diff stats
path: root/tests/rodfiles
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-10-22 22:49:51 +0200
committerAraq <rumpf_a@web.de>2011-10-22 22:49:51 +0200
commitdce8d3d1ab4167c134748108ff66251fe5ca7d7c (patch)
treef571abacf75297d6774b1b2e4ca510609aeab3a2 /tests/rodfiles
parent235bd1c47402a62db097a0bae7d63224b46d02d8 (diff)
downloadNim-dce8d3d1ab4167c134748108ff66251fe5ca7d7c.tar.gz
rod files: next trivial examples working
Diffstat (limited to 'tests/rodfiles')
-rw-r--r--tests/rodfiles/tester.nim30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/rodfiles/tester.nim b/tests/rodfiles/tester.nim
new file mode 100644
index 000000000..d2b5a1581
--- /dev/null
+++ b/tests/rodfiles/tester.nim
@@ -0,0 +1,30 @@
+#
+#
+#            Nimrod Tester
+#        (c) Copyright 2011 Andreas Rumpf
+#
+#    See the file "copying.txt", included in this
+#    distribution, for details about the copyright.
+#
+
+## This program tests Nimrod's ROD file mechanism.
+
+import
+  parseutils, strutils, pegs, os, osproc, streams, parsecfg, browsers, json,
+  marshal, cgi
+
+const
+  cmdTemplate = r"nimrod cc --hints:on $# $#"
+  resultsFile = "testresults.html"
+  jsonFile = "testresults.json"
+  Usage = "usage: tester reject|compile|examples|run|merge [nimrod options]"
+
+proc myExec(cmd: string): string =
+  result = osproc.execProcess(cmd)
+
+var
+  pegLineError = peg"{[^(]*} '(' {\d+} ', ' \d+ ') Error:' \s* {.*}"
+  pegOtherError = peg"'Error:' \s* {.*}"
+  pegSuccess = peg"'Hint: operation successful'.*"
+  pegOfInterest = pegLineError / pegOtherError / pegSuccess
+