test/harness/loupe-test.c
changeset 5 f600b0d1fc5d
parent 0 c2f4c0285180
child 6 faab25d520dd
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/harness/loupe-test.c	Fri Jan 27 10:30:16 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 <bl/bl.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 +}