xref: /freebsd-13.1/share/examples/tests/README (revision 21203fdd)
1*21203fddSJulio Merino$FreeBSD$
2*21203fddSJulio Merino
3*21203fddSJulio MerinoThis directory contains sample test programs along the Makefile and
4*21203fddSJulio MerinoKyuafile logic to get them build and installed.
5*21203fddSJulio Merino
6*21203fddSJulio MerinoThe goal of these test programs is to illustrate, via simple and
7*21203fddSJulio Merinoheaviliy-commented code, how to construct test programs using all the
8*21203fddSJulio Merinosupported interfaces in the system.
9*21203fddSJulio Merino
10*21203fddSJulio MerinoIf you use any files in here as templates for your own code, please
11*21203fddSJulio Merinoremove all comments while doing so and then write your own if necessary.
12*21203fddSJulio Merino
13*21203fddSJulio MerinoThe subdirectories here contain:
14*21203fddSJulio Merino
15*21203fddSJulio Merino* tests/: Regular directory containing the tests code.  Note that the
16*21203fddSJulio Merino  apparently-redundant tests/tests/ path component here is expected for
17*21203fddSJulio Merino  consistency reasons and required to get the right layout under
18*21203fddSJulio Merino  /usr/tests/.
19*21203fddSJulio Merino
20*21203fddSJulio Merino* tests/atf/: Tests that use the ATF libraries, including atf-c, atf-c++
21*21203fddSJulio Merino  and atf-sh.  See kyua-atf-interface(1) for details.
22*21203fddSJulio Merino
23*21203fddSJulio Merino* tests/plain/: Tests that do not use any testing framework.  See
24*21203fddSJulio Merino  kyua-plain-interface(1) for details.
25*21203fddSJulio Merino
26*21203fddSJulio MerinoTo inspect the available sample test cases from an installed system:
27*21203fddSJulio Merino
28*21203fddSJulio Merino    $ kyua list -k /usr/tests/share/examples/tests/Kyuafile
29*21203fddSJulio Merino
30*21203fddSJulio MerinoTo run the full suite of sample test cases:
31*21203fddSJulio Merino
32*21203fddSJulio Merino    $ kyua test -k /usr/tests/share/examples/tests/Kyuafile
33*21203fddSJulio Merino
34*21203fddSJulio MerinoAnd to debug a specific failing test case, if any:
35*21203fddSJulio Merino
36*21203fddSJulio Merino    $ kyua debug -k /usr/tests/share/examples/tests/Kyuafile \
37*21203fddSJulio Merino      atf/cp_test:simple
38