comparison 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
comparison
equal deleted inserted replaced
11:d3ee9efe20e2 12:ee302fe07296
4 import std.path; 4 import std.path;
5 import std.process; 5 import std.process;
6 import std.stdio; 6 import std.stdio;
7 7
8 int main(string[] args) { 8 int main(string[] args) {
9 string[] good;
10 string[] bad; 9 string[] bad;
10 string[] badrun;
11 11
12 auto contents = listdir("test", "*.d"); 12 auto contents = listdir("test", "*.d");
13 foreach(c; contents) { 13 foreach(c; contents) {
14 if (system("./tester.sh "~getName(c)~" ll") != 0) { 14 auto cmd = "./tester.sh "~getName(c);
15 if (system(cmd~" ll") != 0) {
15 bad ~= c; 16 bad ~= c;
16 } 17 }
17 else { 18 else if (system(cmd~" run") != 0) {
18 good ~= c; 19 badrun ~= c;
19 } 20 }
20 } 21 }
21 22
22 int ret = 0; 23 int ret = 0;
23 if (bad.length > 0) { 24 if (bad.length > 0) {
24 writefln(bad.length, '/', contents.length, " tests failed:"); 25 writefln(bad.length, '/', contents.length, " tests failed to compile:");
25 foreach(b; bad) { 26 foreach(b; bad) {
27 writefln(" ",b);
28 }
29 writefln(badrun.length, '/', contents.length, " tests failed to run:");
30 foreach(b; badrun) {
26 writefln(" ",b); 31 writefln(" ",b);
27 } 32 }
28 ret = 1; 33 ret = 1;
29 } 34 }
30 35
31 writefln(good.length, '/', contents.length, " tests passed"); 36 writefln(contents.length - bad.length - badrun.length, '/', contents.length, " tests passed");
32 return ret; 37 return ret;
33 } 38 }