Mercurial > projects > ldc
diff runalltests.d @ 12:ee302fe07296 trunk
[svn r16] * Updated all tests to have a main
* Updated runalltests to both compile and run the tests
author | lindquist |
---|---|
date | Tue, 02 Oct 2007 05:27:44 +0200 |
parents | d3ee9efe20e2 |
children | 0e86428ee567 |
line wrap: on
line diff
--- a/runalltests.d Tue Oct 02 05:10:18 2007 +0200 +++ b/runalltests.d Tue Oct 02 05:27:44 2007 +0200 @@ -6,28 +6,33 @@ import std.stdio; int main(string[] args) { - string[] good; string[] bad; + string[] badrun; auto contents = listdir("test", "*.d"); foreach(c; contents) { - if (system("./tester.sh "~getName(c)~" ll") != 0) { + auto cmd = "./tester.sh "~getName(c); + if (system(cmd~" ll") != 0) { bad ~= c; } - else { - good ~= c; + else if (system(cmd~" run") != 0) { + badrun ~= c; } } int ret = 0; if (bad.length > 0) { - writefln(bad.length, '/', contents.length, " tests failed:"); + writefln(bad.length, '/', contents.length, " tests failed to compile:"); foreach(b; bad) { writefln(" ",b); } + writefln(badrun.length, '/', contents.length, " tests failed to run:"); + foreach(b; badrun) { + writefln(" ",b); + } ret = 1; } - writefln(good.length, '/', contents.length, " tests passed"); + writefln(contents.length - bad.length - badrun.length, '/', contents.length, " tests passed"); return ret; }