OSDN Git Service

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