README 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. -----------
  2. For: User
  3. -----------
  4. Following make targets are available
  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. - V / VERBOSE - run tests with a lot of output
  14. - TIMEOUTFACTOR=nn - increase test timeout nn times.
  15. You can pass the following 2 environment variables to "make run":
  16. - make run SIMULATOR=qemu-sh4
  17. If you need to test just a subset of all test, delete subdirectories
  18. you do not need.
  19. ----------------
  20. For: Developer
  21. ----------------
  22. The structure of this test system is:
  23. test/ toplevel dir containing common test code
  24. test/Rules.mak Common build code
  25. test/Test.mak Runtime test make code
  26. test/subdir/ code specific to a subsystem is stored in a subdir
  27. test/subdir/Makefile.in describe the tests to run
  28. test/subdir/Makefile test entry point, includes needed upper-level
  29. makefiles plus Makefile.in
  30. test/subdir/*.c the tests
  31. Each subdir has a Makefile (same for any subdir) that must include in strict order:
  32. - the upper-level Rules.mak file
  33. - the Makefile.in
  34. - the upper-level Test.mak file
  35. Makefile.in may be used to define the TESTS and TESTS_DISABLED variables.
  36. If you do not, TESTS is built automatically based upon all the .c files in the subdir.
  37. TESTS := foo
  38. TESTS_DISABLED := bar
  39. Each test must use a similar .c name; so the "foo" test needs a "foo.c".
  40. Additionally, the following options further control specific test behavior:
  41. CFLAGS_foo := extra cflags to use to compile test
  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".