linuxthreads: Fix warnings in pthread_tryjoin_np(), pthread_timedjoin_np()
[uclibc-ng.git] / test / README
blob723ce6e4355a829f19dd0dbff5221dd3ac1be5a7
1 -----------
2  For: User
3 -----------
4 Following make targets are avaialable
6 make compile
8 This will compile and link the tests.
10 make run
12 This will execute all the tests.
14 make check
15 make all
17 This will build and run tests.
19 The following make variables may help you in testing:
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.
29 So, to just run the uClibc tests, try this:
30 make check UCLIBC_ONLY=1
32 You can pass the following 2 environment variables to "make run":
33  - make run SIMULATOR_uclibc=qemu-sh4 SIMULATOR_glibc=qemu-x86_64
35 If you need to test just a subset of all test, delete subdirectories
36 you do not need.
38 As of 2009-07, build machinery does not track dependencies on uclibc.
39 If you edit a header and re-run "make compile", it does not re-install it
40 into ../install_dir. If you delete ../install_dir, "make compile"
41 rebuilds uclibc as needed and re-installs ../install_dir,
42 but still does not rebuild testcases.
43 (You can work around it by "touch */*.c" for now).
45 ----------------
46  For: Developer
47 ----------------
49 The structure of this test system is:
50  test/                    toplevel dir containing common test code
51  test/Rules.mak           Common build code
52  test/Test.mak            Runtime test make code
53  test/subdir/             code specific to a subsystem is stored in a subdir
54  test/subdir/Makefile.in  describe the tests to run
55  test/subdir/Makefile     test entry point, includes needed upper-level
56                           makefiles plus Makefile.in
57  test/subdir/*.c          the tests
59 Each subdir has a Makefile (same for any subdir) that must include in strict order:
60   - the upper-level Rules.mak file
61   - the Makefile.in
62   - the upper-level Test.mak file
63 Makefile.in may be used to define the TESTS and TESTS_DISABLED variables.
64 If you do not, TESTS is built automatically based upon all the .c files in the subdir.
65 TESTS := foo
66 TESTS_DISABLED := bar
67 Each test must use a similar .c name; so the "foo" test needs a "foo.c".
69 Additionally, the following options further control specific test behavior:
70 CFLAGS_foo    := extra cflags to use to compile test
71 DODIFF_foo    := compare the output of the glibc and uClibc tests (see below)
72 LDFLAGS_foo   := extra ldflags to use to link test
73 OPTS_foo      := extra options to pass to test
74 RET_foo       := expected exit code of test; default is 0
75 WRAPPER_foo   := execute stuff just before test
77 Or to control all tests in a subdir:
78 EXTRA_CLEAN   := extra files to remove in the clean target
79 EXTRA_DIRS    := extra directories to remove in the clean target
80 EXTRA_CFLAGS  := -DFOO
81 EXTRA_LDFLAGS := -lpthread
82 OPTS          :=
83 WRAPPER       :=
85 If you want to compare the output of a test with known good output, then just
86 create a local file named "foo.out.good" and the output generated by the test
87 "foo" will be automatically stored in "foo.out" and compared to "foo.out.good".