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

View file

@ -1,5 +1,10 @@
This directory contains the test cases.
Each test must have a filename of the form: ``t*.nim``
Each test can contain a spec in ``"""``.
Each test can contain a spec in a ``discard """"""`` block.
The folder ``rodfiles`` contains special tests that test incremental
compilation via symbol files.
The folder ``dll`` contains simple DLL tests.

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