send showerror output to kernel log if neither dos nor intuition are available
[cake.git] / test / clib / all-tests.c
blob97cc280380964c72e1e3a56b34897c576a81b639
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <sys/stat.h>
4 #include "test.h"
6 char *tests[] =
8 "chdir",
9 "strchr",
10 "stpblk",
11 "tmpfile",
13 NULL
16 int main()
18 int total = 0, failed = 0;
19 int i, rc;
20 char buffer[128];
22 mkdir( "T:TestOutput", 0777 );
24 for( i = 0; tests[i] != NULL; i++ )
26 total++;
27 sprintf( buffer, "%s >T:TestOutput/test-%d.log", tests[i], i );
29 rc = system( buffer );
31 if( rc == OK )
33 printf( "." );
34 fflush( stdout );
36 else
38 failed++;
39 printf( "F" );
40 fflush( stdout );
45 printf( "\n\nA total of %d tests run: %d succeded, %d failed.\n", total, total - failed, failed );
47 if( failed > 0 )
49 printf( "\nError messages:\n" );
50 system( "join T:TestOutput/test-#? as T:TestOutput/all-tests.log" );
51 system( "type T:TestOutput/all-tests.log" );
54 system( "delete T:TestOutput ALL QUIET" );
56 return 0;