README 3.0 KB

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