update readme, add dist/config.mak
[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 dist/config.mak .
7         # edit config.mak
8         make
9 run tests:
10         make
11 run benchmarks:
12         make 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 a test function looks like
21         void test_foo() {
22                 if (foo != 42)
23                         error("foo=%d expected 42\n", foo);
24         }
25 extern functions with name ~ /^test/ are recognized to be
26 test functions
27
28 a benchmark function looks like
29         void bench_foo(int N) {
30                 for (i = 0; i < N; i++)
31                         foo();
32         }
33 benchmark functions are repeatedly called with an increasing
34 N until the running time is long enough, then time/N is printed
35
36 see Makefile.inc for build system details
37 see common/t.c for test details
38 see common/b.c for benchmark details