Mercurial > projects > ldc
annotate tests/runminitest.d @ 383:c028fd91b3b0
.hgignore updates. runminitest stores object files separately.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Wed, 23 Jul 2008 18:53:44 +0200 |
parents | d8b165faae9b |
children | 76bf1eaaf4dc |
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"); |
383
c028fd91b3b0
.hgignore updates. runminitest stores object files separately.
Christian Kamm <kamm incasoftware de>
parents:
342
diff
changeset
|
14 if(!exists("obj")) |
c028fd91b3b0
.hgignore updates. runminitest stores object files separately.
Christian Kamm <kamm incasoftware de>
parents:
342
diff
changeset
|
15 mkdir("obj"); |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
16 |
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
17 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
|
18 foreach(c; contents) { |
383
c028fd91b3b0
.hgignore updates. runminitest stores object files separately.
Christian Kamm <kamm incasoftware de>
parents:
342
diff
changeset
|
19 string cmd = format("llvmdc %s -quiet -ofobj/%s", c, getName(c)); |
100 | 20 foreach(v; args[1..$]) { |
21 cmd ~= ' '; | |
22 cmd ~= v; | |
23 } | |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
24 writefln(cmd); |
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
25 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
|
26 bad ~= c; |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
27 } |
383
c028fd91b3b0
.hgignore updates. runminitest stores object files separately.
Christian Kamm <kamm incasoftware de>
parents:
342
diff
changeset
|
28 else if (system("obj/" ~ getName(c)) != 0) { |
12 | 29 badrun ~= c; |
11
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 } |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
32 |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
33 int ret = 0; |
14
0e86428ee567
[svn r18] * Initial support for switch statements - No string switches yet.
lindquist
parents:
12
diff
changeset
|
34 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
|
35 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
|
36 foreach(b; bad) { |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
37 writefln(" ",b); |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
38 } |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
39 writefln(badrun.length, '/', contents.length - bad.length, " of the compiled tests failed to run:"); |
12 | 40 foreach(b; badrun) { |
41 writefln(" ",b); | |
42 } | |
11
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
43 ret = 1; |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
44 } |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
45 |
38
27b2f40bdb58
[svn r42] Disabled the extensive logging by default. Use the -vv flag to get it back.
lindquist
parents:
14
diff
changeset
|
46 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
|
47 return ret; |
d3ee9efe20e2
[svn r15] * Fixed a bunch problems with virtual calls. Seems I did some rather poor testing.
lindquist
parents:
diff
changeset
|
48 } |