Mercurial > projects > ldc
annotate tests/runminitest.d @ 342:d8b165faae9b trunk
[svn r363] Fixed a problem with the mini-test-driver.
author | lindquist |
---|---|
date | Sun, 13 Jul 2008 02:55:41 +0200 |
parents | 1bb99290e03a |
children | c028fd91b3b0 |
rev | line source |
---|---|
341
1bb99290e03a
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
lindquist
parents:
100
diff
changeset
|
1 module runminitest; |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
2 |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
3 import std.file; |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
4 import std.path; |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
5 import std.process; |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
6 import std.stdio; |
342
d8b165faae9b
[svn r363] Fixed a problem with the mini-test-driver.
lindquist
parents:
341
diff
changeset
|
7 import std.string; |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
8 |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
9 int main(string[] args) { |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
10 string[] bad; |
12 | 11 string[] badrun; |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
12 |
341
1bb99290e03a
[svn r362] Started merging the old 'test' dir as well as the newer 'tangotests' dir into 'tests/mini' and 'tests/minicomplex'.
lindquist
parents:
100
diff
changeset
|
13 chdir("mini"); |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
14 |
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
15 auto contents = listdir(".", "*.d"); |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
16 foreach(c; contents) { |
342
d8b165faae9b
[svn r363] Fixed a problem with the mini-test-driver.
lindquist
parents:
341
diff
changeset
|
17 string cmd = format("llvmdc %s -quiet -of%s", c, getName(c)); |
100 | 18 foreach(v; args[1..$]) { |
19 cmd ~= ' '; | |
20 cmd ~= v; | |
21 } | |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
22 writefln(cmd); |
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
23 if (system(cmd) != 0) { |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
24 bad ~= c; |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
25 } |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
26 else if (system(getName(c)) != 0) { |
12 | 27 badrun ~= c; |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
28 } |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
29 } |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
30 |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
31 int ret = 0; |
14
0e86428ee567
[svn r18] * Initial support for switch statements - No string switches yet.
lindquist
parents:
12
diff
changeset
|
32 if (bad.length > 0 || badrun.length > 0) { |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
33 writefln(bad.length, '/', contents.length, " of the tests failed to compile:"); |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
34 foreach(b; bad) { |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
35 writefln(" ",b); |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
36 } |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
37 writefln(badrun.length, '/', contents.length - bad.length, " of the compiled tests failed to run:"); |
12 | 38 foreach(b; badrun) { |
39 writefln(" ",b); | |
40 } | |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
41 ret = 1; |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
42 } |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
43 |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
44 writefln(contents.length - bad.length - badrun.length, '/', contents.length, " of the tests passed"); |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
45 return ret; |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
46 } |