saturday, 23 june 2007

posted at 01:50
tags:

Its nearly 2am, and I'm sleepy. Just a quick one to give you an idea of where this is going:

extern TESTFUNC(init);
extern TESTFUNC(files);
extern TESTFUNC(cleanup);

static TestFunc tests[] = {
    TESTNAME(init),
    TESTNAME(files),
    TESTNAME(cleanup),
    NULL
};

int main(int argc, char **argv) {
    struct TestSuite *ts;
    struct TagItem tags[] = {
        { TS_Plan,        (IPTR) 3     },
        { TS_Functions,   (IPTR) tests },
        { TAG_DONE,       0            }
    };

    ts = CreateTestSuite(tags);
    RunTestSuite(ts);
    DestroyTestSuite(ts); 

    return 0;
}

This is a harness bootstrap. The details are squirreled away in test.library. Note how simple the harness is - it can be generated from your test sources.

Bedtime. More tomorrow, perhaps.