README revision 291089
1129199Scognetsrc/tests: The FreeBSD test suite 2129199Scognet================================= 3129199Scognet 4129199ScognetTo run the FreeBSD test suite: 5129199Scognet(1) Make sure that kyua is installed: 6129199Scognet pkg install kyua 7129199Scognet(2) To run the tests: 8129199Scognet kyua test -k /usr/tests/Kyuafile 9129199Scognet(3) To see the test results: 10129199Scognet kyua report 11135670Scognet 12129199ScognetFor further information on using the test suite, read tests(7): 13129199Scognet man tests 14129199Scognet 15135670ScognetDescription of FreeBSD test suite 16129199Scognet================================= 17129199ScognetThe build of the test suite is organized in the following manner: 18129199Scognet 19129199Scognet* The build of all test artifacts is protected by the MK_TESTS knob. 20152891Simp The user can disable these with the WITHOUT_TESTS setting in 21129199Scognet src.conf(5). 22129199Scognet 23136910Sru* The goal for /usr/tests/ (the installed test programs) is to follow 24129199Scognet the same hierarchy as /usr/src/ wherever possible, which in turn drives 25129199Scognet several of the design decisions described below. This simplifies the 26129199Scognet discoverability of tests. We want a mapping such as: 27129199Scognet 28129199Scognet /usr/src/bin/cp/ -> /usr/tests/bin/cp/ 29129199Scognet /usr/src/lib/libc/ -> /usr/tests/lib/libc/ 30129199Scognet /usr/src/usr.bin/cut/ -> /usr/tests/usr.bin/cut/ 31129199Scognet ... and many more ... 32129199Scognet 33129199Scognet* Test programs for specific utilities and libraries are located next 34129199Scognet to the source code of such programs. For example, the tests for the 35129199Scognet src/lib/libcrypt/ library live in src/lib/libcrypt/tests/. The tests/ 36135670Scognet subdirectory is optional and should, in general, be avoided. 37135670Scognet 38140479Scognet* The src/tests/ hierarchy (this directory) provides generic test 39140479Scognet infrastructure and glue code to join all test programs together into 40140479Scognet a single test suite definition. 41140479Scognet 42140479Scognet* The src/tests/ hierarchy also includes cross-functional test programs: 43140479Scognet i.e. test programs that cover more than a single utility or library 44151423Scognet and thus don't fit anywhere else in the tree. Consider this to follow 45147630Scognet the same rationale as src/share/man/: this directory contains generic 46147630Scognet manual pages while the manual pages that are specific to individual 47153112Scognet tools or libraries live next to the source code. 48147630Scognet 49150862ScognetIn order to keep the src/tests/ hierarchy decoupled from the actual test 50150862Scognetprograms being installed --which is a worthy goal because it simplifies 51150862Scognetthe addition of new test programs and simplifies the maintenance of the 52152782Scognettree-- the top-level Kyuafile does not know which subdirectories may 53152742Scognetexist upfront. Instead, such Kyuafile automatically detects, at 54152742Scognetrun-time, which */Kyuafile files exist and uses those directly. 55153549Scognet 56152742ScognetSimilarly, every directory in src/ that wants to install a Kyuafile to 57152742Scognetjust recurse into other subdirectories reuses this Kyuafile with 58152742Scognetauto-discovery features. As an example, take a look at src/lib/tests/ 59152742Scognetwhose sole purpose is to install a Kyuafile into /usr/tests/lib/. 60152742ScognetThe goal in this specific case is for /usr/tests/lib/ to be generated 61153112Scognetentirely from src/lib/. 62152534Scognet 63152534Scognet-- 64153549Scognet$FreeBSD: head/tests/README 291089 2015-11-20 03:24:04Z rodrigc $ 65153549Scognet