# HG changeset patch # User lindquist # Date 1191295664 -7200 # Node ID ee302fe0729619f487437dfade5f0e3e00a8a21d # Parent d3ee9efe20e2d60eb367e786e0753388d45b4b86 [svn r16] * Updated all tests to have a main * Updated runalltests to both compile and run the tests diff -r d3ee9efe20e2 -r ee302fe07296 runalltests.d --- a/runalltests.d Tue Oct 02 05:10:18 2007 +0200 +++ b/runalltests.d Tue Oct 02 05:27:44 2007 +0200 @@ -6,28 +6,33 @@ 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 -r d3ee9efe20e2 -r ee302fe07296 test/arrayinit.d --- a/test/arrayinit.d Tue Oct 02 05:10:18 2007 +0200 +++ b/test/arrayinit.d Tue Oct 02 05:27:44 2007 +0200 @@ -3,3 +3,8 @@ 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 -r d3ee9efe20e2 -r ee302fe07296 test/classes7.d --- a/test/classes7.d Tue Oct 02 05:10:18 2007 +0200 +++ b/test/classes7.d Tue Oct 02 05:27:44 2007 +0200 @@ -17,5 +17,5 @@ { scope c = new C; c.g(); - assert(c.i == 43); + assert(c.i == 42); } diff -r d3ee9efe20e2 -r ee302fe07296 test/structinit2.d --- a/test/structinit2.d Tue Oct 02 05:10:18 2007 +0200 +++ b/test/structinit2.d Tue Oct 02 05:27:44 2007 +0200 @@ -6,3 +6,11 @@ long l; float f; } + +void main() +{ + Imp i; + assert(i.i == 0); + assert(i.l == 0L); + assert(i.f !<>= 0.0f); +}