readme fix
[libc-test] / README
1 simple libc tests
2 based on the libc-testsuit and libc-bench of dalias
3 see http://git.etalabs.net/cgi-bin/gitweb.cgi
4
5 build tests:
6         cp Makefile.conf.def Makefile.conf
7         # edit Makefile.conf
8         make
9 run tests:
10         ./t
11 run benchmarks:
12         ./b
13
14 framework:
15
16 the only hook in the test framework is error(...) which
17 prints a formatted message and sets the test to failed
18 see common/test.h
19
20 in the root directory make builds an executable with all tests
21 in a src/* directory make builds only local tests
22 see Makefile.inc
23
24 a test function looks like
25         void test_foo() {
26                 if (foo != 42)
27                         error("foo=%d expected 42\n", foo);
28         }
29 extern functions with name ~ /^test/ are recognized to be
30 test functions
31 see Makefile.inc
32
33 a benchmark function looks like
34         void bench_foo(int N) {
35                 for (i = 0; i < N; i++)
36                         foo();
37         }
38 benchmark functions are repeatedly called with an increasing
39 N until the runing time is long enough, then time/N is printed
40
41 edit the generated tests.h to exclude certain tests
42 see common/t.c for tests
43 see common/b.c for benchmarks