rod files: next trivial examples working

This commit is contained in:
Araq 2011-10-22 22:49:51 +02:00
commit dce8d3d1ab
13 changed files with 70 additions and 1034 deletions

30
tests/rodfiles/tester.nim Normal file
View file

@ -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