README 3.1 KB

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