README 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. -----------
  2. For: User
  3. -----------
  4. Following make targets are avaialable
  5. make compile
  6. This will compile and link the tests
  7. make run
  8. This will check for binaries if they are not there it
  9. will call 'compile' target then it will execute all the
  10. tests.
  11. make check
  12. make all
  13. This will build and run tests.
  14. The following make variables may help you in testing:
  15. - UCLIBC_ONLY - only run tests against uClibc
  16. - GLIBC_ONLY - only run tests against glibc
  17. - V / VERBOSE - run tests with a lot of output
  18. - TEST_INSTALLED_UCLIBC - Test installed libraries
  19. under /lib and /usr/lib.
  20. - TIMEOUTFACTOR=nn - increase test timeout nn times.
  21. At least REGEX_OLD + regex/tst-regex2 needs it increased.
  22. So, to just run the uClibc tests, try this:
  23. make check UCLIBC_ONLY=1
  24. ----------------
  25. For: Developer
  26. ----------------
  27. The structure of this test system is:
  28. test/ toplevel dir containing common test code
  29. test/Rules.mak Common build code
  30. test/Test.mak Runtime test make code
  31. test/subdir/ code specific to a subsystem is stored in a subdir
  32. test/subdir/Makefile.in describe the tests to run
  33. test/subdir/Makefile test entry point, includes needed upper-level
  34. makefiles plus Makefile.in
  35. test/subdir/*.c the tests
  36. Each subdir has a Makefile (same for any subdir) that must include in strict order :
  37. - the upper-level Rules.mak file.
  38. - the Makefile.in .
  39. - the upper-level Test.mak file.
  40. Makefile.in may be used to define the TESTS and TESTS_DISABLED variables. If you do not, TESTS
  41. is built automatically based upon all the .c files in the subdir.
  42. TESTS := foo
  43. TESTS_DISABLED := bar
  44. Each test must use a similar .c name; so the "foo" test needs a "foo.c".
  45. Additionally, the following options further control specific test behavior:
  46. CFLAGS_foo := extra cflags to use to compile test
  47. DODIFF_foo := compare the output of the glibc and uClibc tests (see below)
  48. LDFLAGS_foo := extra ldflags to use to link test
  49. OPTS_foo := extra options to pass to test
  50. RET_foo := expected exit code of test; default is 0
  51. WRAPPER_foo := execute stuff just before test
  52. Or to control all tests in a subdir:
  53. EXTRA_CLEAN := extra files to remove in the clean target
  54. EXTRA_DIRS := extra directories to remove in the clean target
  55. EXTRA_CFLAGS := -DFOO
  56. EXTRA_LDFLAGS := -lpthread
  57. OPTS :=
  58. WRAPPER :=
  59. If you want to compare the output of a test with known good output, then just
  60. create a local file named "foo.out.good" and the output generated by the test
  61. "foo" will be automatically stored in "foo.out" and compared to "foo.out.good".