test/harness/loupe-test.c
author ali <ali@juiblex.co.uk>
Fri Jan 27 10:30:16 2012 +0000 (2012-01-27)
changeset 5 f600b0d1fc5d
parent 0 test/harness/gc-test.c@c2f4c0285180
child 6 faab25d520dd
permissions -rw-r--r--
Rename to bookloupe
     1 #include <stdlib.h>
     2 #include <stdio.h>
     3 #include <string.h>
     4 #include <bl/bl.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 }