1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/harness/gc-test.c Wed Jan 25 19:33:43 2012 +0000
1.3 @@ -0,0 +1,31 @@
1.4 +#include <stdlib.h>
1.5 +#include <stdio.h>
1.6 +#include <string.h>
1.7 +#include <gclib/gclib.h>
1.8 +#include "testcase.h"
1.9 +#include "testcaseio.h"
1.10 +
1.11 +/*
1.12 + * Returns FALSE if the test should be considered to have failed.
1.13 + * (returns TRUE on pass or expected-fail).
1.14 + */
1.15 +boolean run_test(const char *filename)
1.16 +{
1.17 + Testcase *testcase;
1.18 + boolean retval;
1.19 + testcase=testcase_parse_file(filename);
1.20 + if (!testcase)
1.21 + return FALSE;
1.22 + retval=testcase_run(testcase);
1.23 + testcase_free(testcase);
1.24 + return retval;
1.25 +}
1.26 +
1.27 +int main(int argc,char **argv)
1.28 +{
1.29 + int i;
1.30 + boolean pass=TRUE;
1.31 + for(i=1;i<argc;i++)
1.32 + pass&=run_test(argv[i]);
1.33 + return pass?0:1;
1.34 +}