[svn r16] * Updated all tests to have a main

* Updated runalltests to both compile and run the tests
This commit is contained in:
Tomas Lindquist Olsen
2007-10-02 05:27:44 +02:00
parent 4eab68b36c
commit 6e85d0f89e
4 changed files with 25 additions and 7 deletions

View File

@@ -6,28 +6,33 @@ import std.process;
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;
}

View File

@@ -3,3 +3,8 @@ float[4] ftable = [1,2,3,4];
int[8] itable = [3:42,6:123];
private uint[7] crc32_table = [0x00000000,0x77073096,0xee0e612c,0x990951ba,0x076dc419,0x706af48f,0xe963a535];
void main()
{
assert(crc32_table[3] == 0x990951ba);
}

View File

@@ -17,5 +17,5 @@ void main()
{
scope c = new C;
c.g();
assert(c.i == 43);
assert(c.i == 42);
}

View File

@@ -6,3 +6,11 @@ struct Imp
long l;
float f;
}
void main()
{
Imp i;
assert(i.i == 0);
assert(i.l == 0L);
assert(i.f !<>= 0.0f);
}