Provide a mechanism whereby a test sub-directory can be installed,
without the test being scheduled to run by default (ie: keeping
it out of the Atffile, and Kyuafile if Kyua is enabled.).
The mechanism is perhaps a bit kludgey - anyone with a better idea
how to make it happen, feel free to improve this (the one user as
of about the time of this commit is (or will be) src/tests/lib/Makefile)
This is suboptimal: the current high-level definitions of test programs
in the Makefiles do not carry enough information to support all the
features of Kyuafiles. For example, it is not possible to register test
programs that do *not* use the ATF libraries, which is something that
has been frequently requested around here; nor it is possible to attach
arbitrary metadata to test programs from the Makefile, which is handy
particularly for ATF-less test programs.
For these reasons, consider this a transitional step.
Note that, with this change, you should now be able to use the 'kyua'
tool to run the tests in /usr/tests.
Atffile generation.
This is needed to be able to generate Kyuafiles (coming later), as these
clearly differentiate between the definition of test programs and the
recursion into other subdirectories (or files).
In particular: rename ATFFILE_EXTRA_TPS to ATFFILE_EXTRA_SUBDIRS and
change the logic in bsd.test.mk to keep track of subdirectories aside from
_TESTS when creating the Atffile.
The new ATFFILE_EXTRA_TPS variable can hold a set of test programs or
subdirectories to be added to the generated Atffile, without needing these
to be built by the current Makefile.
This is to be used in conjunction with MK* knobs and external/ so that
a 3rd-party component can place its tests in the corresponding tests/
directory and have the parent Atffile recognize them.
An alternative would be to use 'tp-glob' in the Atffile and list the names
of the directories/tests that may or may not exist. However, this would
require providing manually-crafted Atffiles -- and because the majority are
auto-generated, there would be some confusion.
C and C++ test programs in the same Makefile, and prevents regular programs
from being polluted by libraries that they may not need.
Suggested by Garrett Cooper in private mail, although I redid his patch.
- Add to variables only once, instead of from within a loop.
- Use :tl instead of :M to match against strings for readability.
- Use CLEANFILES instead of a custom clean target.
Full release built successfully after this change.
This change adds the ATFFILE variable, which can take the following values:
- yes: The source directory contains a static Atffile to be installed.
- auto: The Atffile is automatically generated.
- no: Do not install any Atffile (replaces the previous NOATFFILE variable).
The ugly bit of this is that I have to add a TESTS_SUBDIRS variable that
lists the subdirectories that contain test cases (so that they can be listed
in the Atffiles, without including auxiliary directories without tests).
This is a subset of SUBDIR.
Addresses a minor part of PR bin/43394.
make test may yield misleading results but should work in many cases. This
target is supposed to simplify the execution of tests but does not preclude
developers from running the installed versions.
Addresses PR misc/38326.
contents of the generated scripts may change (as will happen with ATF 0.4),
so this dependency is important to have. Dunno how to deal with the
non-tools case other than adding an entry in UPDATING, but if you are not
using tools, you can expect all kinds of breakage.
This file simplifies the build of test programs, either written in C++
or in sh. It hides the internals of atf, e.g. by silently linking
against -latf or calling atf-compile.
It also takes care of installing an Atffile for each new test directory.