diff --git a/runalltests.d b/runalltests.d index b174cbd2..9a426a7d 100644 --- a/runalltests.d +++ b/runalltests.d @@ -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; } diff --git a/test/arrayinit.d b/test/arrayinit.d index a9f6d1a3..e5c19bb0 100644 --- a/test/arrayinit.d +++ b/test/arrayinit.d @@ -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); +} diff --git a/test/classes7.d b/test/classes7.d index 2869d711..12be32e5 100644 --- a/test/classes7.d +++ b/test/classes7.d @@ -17,5 +17,5 @@ void main() { scope c = new C; c.g(); - assert(c.i == 43); + assert(c.i == 42); } diff --git a/test/structinit2.d b/test/structinit2.d index 71bc0064..5b1f1169 100644 --- a/test/structinit2.d +++ b/test/structinit2.d @@ -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); +}