view runalltests.d @ 270:d9d5d59873d8 trunk

[svn r291] Fixed a bunch of the old Phobos tests to work with Tango. Branch statements now emit a new block after it. Fixed the _adSort runtime function had a bad signature. Added a missing dot prefix on compiler generated string tables for string switch. Fixed, PTRSIZE seems like it was wrong on 64bit, now it definitely gets set properly.
author lindquist
date Mon, 16 Jun 2008 16:01:19 +0200
parents 5071469303d4
children
line wrap: on
line source

module runalltests;

import std.file;
import std.path;
import std.process;
import std.stdio;

int main(string[] args) {
    string[] bad;
    string[] badrun;

    chdir("test");

    auto contents = listdir(".", "*.d");
    foreach(c; contents) {
        string cmd = "llvmdc -quiet "~c;
        foreach(v; args[1..$]) {
            cmd ~= ' ';
            cmd ~= v;
        }
        writefln(cmd);
        if (system(cmd) != 0) {
            bad ~= c;
        }
        else if (system(getName(c)) != 0) {
            badrun ~= c;
        }
    }

    int ret = 0;
    if (bad.length > 0 || badrun.length > 0) {
        writefln(bad.length, '/', contents.length, " of the tests failed to compile:");
        foreach(b; bad) {
            writefln("  ",b);
        }
        writefln(badrun.length, '/', contents.length - bad.length, " of the compiled tests failed to run:");
        foreach(b; badrun) {
            writefln("  ",b);
        }
        ret = 1;
    }

    writefln(contents.length - bad.length - badrun.length, '/', contents.length, " of the tests passed");
    return ret;
}