Home | History | Annotate | Download | only in mk
History log of /src/share/mk/bsd.test.mk
RevisionDateAuthorComments
 1.26  21-Jan-2019  christos Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.
 1.25  23-Nov-2017  kre branches: 1.25.2; 1.25.4;
PR lib/52007

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)
 1.24  23-Feb-2013  jmmv branches: 1.24.22;
Autogenerate Kyuafiles next to Atffiles when MKKYUA is set.

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.
 1.23  23-Feb-2013  jmmv Stop assuming that test programs and directories are the same thing during
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.
 1.22  16-Feb-2013  jmmv Add ATFFILE_EXTRA_TPS.

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.
 1.21  25-Aug-2012  jmmv branches: 1.21.2;
Fix "make test" to actually print the desired message when atf-run fails.
It was being skipped due to the set -e in the code snippet and the failure
to properly capture atf-run's exit code.
 1.20  24-Aug-2012  jmmv Make DPADD and LDADD specific to the test programs. This allows mixing
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.
 1.19  10-Sep-2011  apb branches: 1.19.2;
Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.
 1.18  14-May-2011  jmmv Remove any stale .fifo files when doing 'test'. These may be leaked if
the user aborts the execution of atf-run with Ctrl+C, which will prevent
a subsequent 'make test' from working at all.
 1.17  27-Mar-2011  plunky if not including <bsd.prog.mk> then we need to clean up our own mess
 1.16  20-Feb-2011  jmmv Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.
 1.15  16-Feb-2011  jmmv Miscellaneous improvements from Garrett Cooper:
- 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.
 1.14  06-Feb-2011  jmmv Fix the 'test' target to force atf to use its own files from DESTDIR instead
of the installed ones. This is achieved by overriding all ATF_* environment
variables and making them point inside DESTDIR.
 1.13  23-Aug-2010  joerg branches: 1.13.2;
Simplify.
 1.12  02-Aug-2010  jmmv Move the TESTSBASE definition from bsd.test.mk to bsd.own.mk. Per joerg@'s
suggestion.
 1.11  13-Jul-2010  jmmv Implement Atffile automatic generation.

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.
 1.10  18-Jun-2010  jmmv Prevent build breakage if TESTSDIR is not defined (as in tests/modules/k_helper).
 1.9  18-Jun-2010  jmmv Add a experimental "make test" target

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.
 1.8  04-Jun-2010  jmmv Simplify build of shell-based test cases: atf-compile is gone.
 1.7  01-May-2008  jmmv Add support for a TESTS_C variable to make use of the new C-only binding
that comes with atf-0.5. Also fix linkage of C++ tests.
 1.6  02-Mar-2008  jmmv branches: 1.6.2; 1.6.4;
Fix build of tests when USETOOLS=no. Reported by veego@ in current-users
and notified to me by martin@.
 1.5  10-Feb-2008  jmmv branches: 1.5.2;
Allow Makefiles to skip the installation of an Atffile by defining NOATFFILE.
This is to be able to get the definition of TESTSBASE, which maybe should be
part of bsd.own.mk...
 1.4  05-Feb-2008  drochner include bsd.init.mk so that eg USETOOLS is available to
client Makefiles, approved by jmmv
 1.3  04-Feb-2008  jmmv Rebuild shell-based tests if the atf-compile host tool has changed. The
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.
 1.2  21-Nov-2007  jmmv branches: 1.2.4;
No need to set a value for TESTSDIR any more as this is explicitly set
wherever it is needed.
 1.1  12-Nov-2007  jmmv Add the bsd.test.mk file

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.
 1.2.4.3  23-Mar-2008  matt sync with HEAD
 1.2.4.2  09-Jan-2008  matt sync with HEAD
 1.2.4.1  21-Nov-2007  matt file bsd.test.mk was added on branch matt-armv6 on 2008-01-09 01:39:26 +0000
 1.5.2.1  24-Mar-2008  keiichi sync with head.
 1.6.4.1  18-May-2008  yamt sync with head.
 1.6.2.2  02-Jun-2008  mjf Sync with HEAD.
 1.6.2.1  02-Mar-2008  mjf file bsd.test.mk was added on branch mjf-devfs2 on 2008-06-02 13:21:43 +0000
 1.13.2.3  05-Mar-2011  bouyer Sync with HEAD
 1.13.2.2  17-Feb-2011  bouyer Sync with HEAD
 1.13.2.1  08-Feb-2011  bouyer Sync with HEAD
 1.19.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.2.1  30-Oct-2012  yamt sync with head
 1.21.2.1  25-Feb-2013  tls resync with head
 1.24.22.1  01-Mar-2018  martin Pull up following revision(s) (requested by kre in ticket #598):
tests/lib/Makefile: revision 1.30
share/mk/bsd.test.mk: revision 1.25
PR lib/52007
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)
PR lib/52007
Move libevent from being a test playing sub-directory, to a groupy,
just hanging around, hoping someone will notice it, and throw it
a bone... (mixed metaphors?)
 1.25.4.1  10-Jun-2019  christos Sync with HEAD
 1.25.2.1  26-Jan-2019  pgoyette Sync with HEAD

RSS XML Feed