freebsd-dev/share/examples/tests/README
Julio Merino 21203fdd06 Add some sample test programs.
This change adds some sample test cases to share/examples/tests/
demonstrating the basic usage of the atf and plain interfaces.

These test programs are fully-functional and are installed as part
of the test suite, which guarantees that the sample code remains
correct.  However, they currently mostly serve as a placeholder for
additional examples and may be incomplete (depending on how you
look at them).  I will see what else can be useful while working on
documentation.

As a bonus, the addition of these tests exercise the *.test.mk files,
one of which (plain.test.mk) was not yet in use, and also demonstrates
that it's possible to mix different kinds of test programs into the
same test suite.

Approved by:	rpaulo (mentor)
2013-11-18 12:57:46 +00:00

38 lines
1.3 KiB
Plaintext

$FreeBSD$
This directory contains sample test programs along the Makefile and
Kyuafile logic to get them build and installed.
The goal of these test programs is to illustrate, via simple and
heaviliy-commented code, how to construct test programs using all the
supported interfaces in the system.
If you use any files in here as templates for your own code, please
remove all comments while doing so and then write your own if necessary.
The subdirectories here contain:
* tests/: Regular directory containing the tests code. Note that the
apparently-redundant tests/tests/ path component here is expected for
consistency reasons and required to get the right layout under
/usr/tests/.
* tests/atf/: Tests that use the ATF libraries, including atf-c, atf-c++
and atf-sh. See kyua-atf-interface(1) for details.
* tests/plain/: Tests that do not use any testing framework. See
kyua-plain-interface(1) for details.
To inspect the available sample test cases from an installed system:
$ kyua list -k /usr/tests/share/examples/tests/Kyuafile
To run the full suite of sample test cases:
$ kyua test -k /usr/tests/share/examples/tests/Kyuafile
And to debug a specific failing test case, if any:
$ kyua debug -k /usr/tests/share/examples/tests/Kyuafile \
atf/cp_test:simple