OSDN Git Service

document new features
[uclinux-h8/uClibc.git] / test / README
1 -----------
2  For: User
3 -----------
4
5 The following make variables may help you in testing:
6  - UCLIBC_ONLY  - only run tests against uClibc
7  - GLIBC_ONLY   - only run tests against glibc
8  - COMPILE_ONLY - just build the tests, don't run them
9  - V / VERBOSE  - run tests with a lot of output
10
11 So, to just run the uClibc tests, try this:
12 make check UCLIBC_ONLY=1
13
14 ----------------
15  For: Developer
16 ----------------
17
18 The structure of this test system is:
19  test/                 toplevel dir containing common test code
20  test/Rules.mak        Common build code
21  test/Test.mak         Runtime test make code
22  test/subdir/          code specific to a subsystem is stored in a subdir
23  test/subdir/Makefile  describe the tests to run
24  test/subdir/*.c       the tests
25
26 Each subdir Makefile must include the toplevel Test.mak file.  Before doing so,
27 you may define the TESTS and TESTS_DISABLED variables.  If you do not, TESTS
28 is built automatically based upon all the .c files in the subdir.
29 TESTS := foo
30 TESTS_DISABLED := bar
31 include ../Test.mak
32 Each test must use a similar .c name; so the "foo" test needs a "foo.c".
33
34 Additionally, the following options further control specific test behavior:
35 CFLAGS_foo    := extra cflags to use to compile test
36 DODIFF_foo    := compare the output of the glibc and uClibc tests (see below)
37 LDFLAGS_foo   := extra ldflags to use to link test
38 OPTS_foo      := extra options to pass to test
39 RET_foo       := expected exit code of test; default is 0
40 WRAPPER_foo   := execute stuff just before test
41
42 Or to control all tests in a subdir:
43 EXTRA_CLEAN   := extra files to remove in the clean target
44 EXTRA_CFLAGS  := -DFOO
45 EXTRA_LDFLAGS := -lpthread
46 OPTS          := 
47 WRAPPER       := 
48
49 If you want to compare the output of a test with known good output, then just
50 create a local file named "foo.out.good" and the output generated by the test
51 "foo" will be automatically stored in "foo.out" and compared to "foo.out.good".