Mercurial > projects > ldc
comparison tests/runminitest.d @ 341:1bb99290e03a trunk
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:51:19 +0200 |
parents | runalltests.d@5071469303d4 |
children | d8b165faae9b |
comparison
equal
deleted
inserted
replaced
340:351c0077d0b3 | 341:1bb99290e03a |
---|---|
1 module runminitest; | |
2 | |
3 import std.file; | |
4 import std.path; | |
5 import std.process; | |
6 import std.stdio; | |
7 | |
8 int main(string[] args) { | |
9 string[] bad; | |
10 string[] badrun; | |
11 | |
12 chdir("mini"); | |
13 | |
14 auto contents = listdir(".", "*.d"); | |
15 foreach(c; contents) { | |
16 string cmd = "llvmdc -quiet "~c; | |
17 foreach(v; args[1..$]) { | |
18 cmd ~= ' '; | |
19 cmd ~= v; | |
20 } | |
21 writefln(cmd); | |
22 if (system(cmd) != 0) { | |
23 bad ~= c; | |
24 } | |
25 else if (system(getName(c)) != 0) { | |
26 badrun ~= c; | |
27 } | |
28 } | |
29 | |
30 int ret = 0; | |
31 if (bad.length > 0 || badrun.length > 0) { | |
32 writefln(bad.length, '/', contents.length, " of the tests failed to compile:"); | |
33 foreach(b; bad) { | |
34 writefln(" ",b); | |
35 } | |
36 writefln(badrun.length, '/', contents.length - bad.length, " of the compiled tests failed to run:"); | |
37 foreach(b; badrun) { | |
38 writefln(" ",b); | |
39 } | |
40 ret = 1; | |
41 } | |
42 | |
43 writefln(contents.length - bad.length - badrun.length, '/', contents.length, " of the tests passed"); | |
44 return ret; | |
45 } |