OSDN Git Service

LT.old: Make __errno_location/__h_errno_location thread safe
[uclinux-h8/uClibc.git] / test / README
1 -----------
2  For: User
3 -----------
4 Following make targets are avaialable
5
6 make compile
7
8 This will compile and link the tests
9
10 make run
11
12 This will check for binaries, if they are not there it
13 will call 'compile' target, then it will execute all the tests.
14
15 make check
16 make all
17
18 This will build and run tests.
19
20 The following make variables may help you in testing:
21
22  - UCLIBC_ONLY  - only run tests against uClibc
23  - GLIBC_ONLY   - only run tests against glibc
24  - V / VERBOSE  - run tests with a lot of output
25  - TEST_INSTALLED_UCLIBC - Test installed libraries
26                            under /lib and /usr/lib.
27  - TIMEOUTFACTOR=nn - increase test timeout nn times.
28                   At least REGEX_OLD + regex/tst-regex2 needs it increased.
29
30 So, to just run the uClibc tests, try this:
31 make check UCLIBC_ONLY=1
32
33 If you need to test just a subset of all test, delete subdirectories
34 you do not need.
35
36 As of 2009-07, build machinery does not track dependencies on uclibc.
37 If you edit a header and re-run "make compile", it does not re-install it
38 into ../install_dir. If you delete ../install_dir, "make compile"
39 rebuilds uclibc as needed and re-installs ../install_dir,
40 but still does not rebuild testcases.
41 (You can work around it by "touch */*.c" for now).
42
43 ----------------
44  For: Developer
45 ----------------
46
47 The structure of this test system is:
48  test/                    toplevel dir containing common test code
49  test/Rules.mak           Common build code
50  test/Test.mak            Runtime test make code
51  test/subdir/             code specific to a subsystem is stored in a subdir
52  test/subdir/Makefile.in  describe the tests to run
53  test/subdir/Makefile     test entry point, includes needed upper-level
54                           makefiles plus Makefile.in
55  test/subdir/*.c          the tests
56
57 Each subdir has a Makefile (same for any subdir) that must include in strict order:
58   - the upper-level Rules.mak file
59   - the Makefile.in
60   - the upper-level Test.mak file
61 Makefile.in may be used to define the TESTS and TESTS_DISABLED variables.
62 If you do not, TESTS is built automatically based upon all the .c files in the subdir.
63 TESTS := foo
64 TESTS_DISABLED := bar
65 Each test must use a similar .c name; so the "foo" test needs a "foo.c".
66
67 Additionally, the following options further control specific test behavior:
68 CFLAGS_foo    := extra cflags to use to compile test
69 DODIFF_foo    := compare the output of the glibc and uClibc tests (see below)
70 LDFLAGS_foo   := extra ldflags to use to link test
71 OPTS_foo      := extra options to pass to test
72 RET_foo       := expected exit code of test; default is 0
73 WRAPPER_foo   := execute stuff just before test
74
75 Or to control all tests in a subdir:
76 EXTRA_CLEAN   := extra files to remove in the clean target
77 EXTRA_DIRS    := extra directories to remove in the clean target
78 EXTRA_CFLAGS  := -DFOO
79 EXTRA_LDFLAGS := -lpthread
80 OPTS          :=
81 WRAPPER       :=
82
83 If you want to compare the output of a test with known good output, then just
84 create a local file named "foo.out.good" and the output generated by the test
85 "foo" will be automatically stored in "foo.out" and compared to "foo.out.good".