README 3.1 KB

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