test/harness/loupe-test.c
author ali <ali@juiblex.co.uk>
Mon Feb 06 23:55:27 2012 +0000 (2012-02-06)
changeset 17 2c88fd553e5d
parent 6 faab25d520dd
child 96 8c2d6a0cf717
permissions -rw-r--r--
Add support for false-positives, etc.
     1 #include <stdlib.h>
     2 #include <stdio.h>
     3 #include <string.h>
     4 #include <glib.h>
     5 #include <bl/bl.h>
     6 #include "testcase.h"
     7 #include "testcaseio.h"
     8 
     9 /*
    10  * Returns FALSE if the test should be considered to have failed.
    11  * (returns TRUE on pass or expected-fail).
    12  */
    13 gboolean run_test(const char *filename)
    14 {
    15     Testcase *testcase;
    16     gboolean retval;
    17     testcase=testcase_parse_file(filename);
    18     if (!testcase)
    19 	return FALSE;
    20     retval=testcase_run(testcase);
    21     testcase_free(testcase);
    22     return retval;
    23 }
    24 
    25 int main(int argc,char **argv)
    26 {
    27     int i;
    28     gboolean pass=TRUE;
    29     bl_set_print_handlers();
    30     for(i=1;i<argc;i++)
    31 	pass&=run_test(argv[i]);
    32     return pass?0:1;
    33 }