test/harness/gc-test.c
author ali <ali@juiblex.co.uk>
Thu Jan 26 23:35:52 2012 +0000 (2012-01-26)
changeset 3 ec364358631b
permissions -rw-r--r--
Non-win32 platforms might need mkstemp too
     1 #include <stdlib.h>
     2 #include <stdio.h>
     3 #include <string.h>
     4 #include <gclib/gclib.h>
     5 #include "testcase.h"
     6 #include "testcaseio.h"
     7 
     8 /*
     9  * Returns FALSE if the test should be considered to have failed.
    10  * (returns TRUE on pass or expected-fail).
    11  */
    12 boolean run_test(const char *filename)
    13 {
    14     Testcase *testcase;
    15     boolean retval;
    16     testcase=testcase_parse_file(filename);
    17     if (!testcase)
    18 	return FALSE;
    19     retval=testcase_run(testcase);
    20     testcase_free(testcase);
    21     return retval;
    22 }
    23 
    24 int main(int argc,char **argv)
    25 {
    26     int i;
    27     boolean pass=TRUE;
    28     for(i=1;i<argc;i++)
    29 	pass&=run_test(argv[i]);
    30     return pass?0:1;
    31 }