README 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. So, to just run the uClibc tests, try this:
  21. make check UCLIBC_ONLY=1
  22. ----------------
  23. For: Developer
  24. ----------------
  25. The structure of this test system is:
  26. test/ toplevel dir containing common test code
  27. test/Rules.mak Common build code
  28. test/Test.mak Runtime test make code
  29. test/subdir/ code specific to a subsystem is stored in a subdir
  30. test/subdir/Makefile describe the tests to run
  31. test/subdir/*.c the tests
  32. Each subdir Makefile must include the toplevel Test.mak file. Before doing so,
  33. you may define the TESTS and TESTS_DISABLED variables. If you do not, TESTS
  34. is built automatically based upon all the .c files in the subdir.
  35. TESTS := foo
  36. TESTS_DISABLED := bar
  37. include ../Test.mak
  38. Each test must use a similar .c name; so the "foo" test needs a "foo.c".
  39. Additionally, the following options further control specific test behavior:
  40. CFLAGS_foo := extra cflags to use to compile test
  41. DODIFF_foo := compare the output of the glibc and uClibc tests (see below)
  42. LDFLAGS_foo := extra ldflags to use to link test
  43. OPTS_foo := extra options to pass to test
  44. RET_foo := expected exit code of test; default is 0
  45. WRAPPER_foo := execute stuff just before test
  46. Or to control all tests in a subdir:
  47. EXTRA_CLEAN := extra files to remove in the clean target
  48. EXTRA_DIRS := extra directories to remove in the clean target
  49. EXTRA_CFLAGS := -DFOO
  50. EXTRA_LDFLAGS := -lpthread
  51. OPTS :=
  52. WRAPPER :=
  53. If you want to compare the output of a test with known good output, then just
  54. create a local file named "foo.out.good" and the output generated by the test
  55. "foo" will be automatically stored in "foo.out" and compared to "foo.out.good".