Search
lxdream.org :: lxdream/test/testdata.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/testdata.c
changeset 263:6f641270b2aa
prev190:f7653df5e832
next266:2f811793bd0a
author nkeynes
date Wed Jan 03 09:05:13 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Extract test runner from testide into the generic testdata.c
Add initial display tests (PAL timings)
file annotate diff log raw
1.1 --- a/test/testdata.c Wed Aug 02 04:13:15 2006 +0000
1.2 +++ b/test/testdata.c Wed Jan 03 09:05:13 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: testdata.c,v 1.2 2006-08-02 04:13:15 nkeynes Exp $
1.6 + * $Id: testdata.c,v 1.3 2007-01-03 09:05:13 nkeynes Exp $
1.7 *
1.8 * Test data loader.
1.9 *
1.10 @@ -195,3 +195,19 @@
1.11 fclose(f);
1.12 return head;
1.13 }
1.14 +
1.15 +int run_tests( test_func_t *test_fns ) {
1.16 + int test_count, test_failures = 0;
1.17 +
1.18 + for( test_count=0; test_fns[test_count] != NULL; test_count++ ) {
1.19 + test_count++;
1.20 + if( test_fns[test_count]() != 0 ) {
1.21 + fprintf( stderr, "Test %d failed\n", test_count+1 );
1.22 + test_failures++;
1.23 + }
1.24 + }
1.25 +
1.26 + /* report */
1.27 + fprintf( stderr, "%d/%d tests passed!\n", test_count - test_failures, test_count );
1.28 + return test_failures;
1.29 +}
.