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