Commit Graph

26 Commits

Author SHA1 Message Date
christos 0a4f449bbb 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.
2019-01-21 21:11:54 +00:00
kre 0844aa3d8b 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)
2017-11-23 02:39:28 +00:00
jmmv 704facb580 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.
2013-02-23 22:01:51 +00:00
jmmv 5b7eb38d00 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.
2013-02-23 21:20:14 +00:00
jmmv 3bd42d5026 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.
2013-02-16 15:00:44 +00:00
jmmv 15cd91994b 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.
2012-08-25 22:21:16 +00:00
jmmv afbfa91c1d 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.
2012-08-24 20:28:19 +00:00
apb 386a389aab Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.
2011-09-10 16:57:35 +00:00
jmmv 21bb82bc2e 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.
2011-05-14 17:47:28 +00:00
plunky bbe1bca01a if not including <bsd.prog.mk> then we need to clean up our own mess 2011-03-27 14:22:02 +00:00
jmmv 07be9009b6 Define LIBATF_C and LIBATF_CXX to point to their corresponding .a files and
use these to properly set DPADD for test programs.
2011-02-20 20:16:01 +00:00
jmmv 814b005f0c 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.
2011-02-16 10:13:00 +00:00
jmmv 3b500cc2c3 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.
2011-02-06 19:38:48 +00:00
joerg 09dba18788 Simplify. 2010-08-23 16:03:03 +00:00
jmmv eed27dd4f1 Move the TESTSBASE definition from bsd.test.mk to bsd.own.mk. Per joerg@'s
suggestion.
2010-08-02 07:08:26 +00:00
jmmv dad604ce0c 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.
2010-07-13 21:11:41 +00:00
jmmv 6fd7d9f8b8 Prevent build breakage if TESTSDIR is not defined (as in tests/modules/k_helper). 2010-06-18 13:14:21 +00:00
jmmv 92a7fda174 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.
2010-06-18 10:10:57 +00:00
jmmv 727dd8cd9e Simplify build of shell-based test cases: atf-compile is gone. 2010-06-04 08:35:09 +00:00
jmmv 01ab96ad80 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.
2008-05-01 15:36:36 +00:00
jmmv f51186f572 Fix build of tests when USETOOLS=no. Reported by veego@ in current-users
and notified to me by martin@.
2008-03-02 11:31:42 +00:00
jmmv 1abe396003 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...
2008-02-10 12:28:54 +00:00
drochner 992ef89b0e include bsd.init.mk so that eg USETOOLS is available to
client Makefiles, approved by jmmv
2008-02-05 17:50:47 +00:00
jmmv 1561f4867f 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.
2008-02-04 14:15:57 +00:00
jmmv 1a8b914c59 No need to set a value for TESTSDIR any more as this is explicitly set
wherever it is needed.
2007-11-21 15:40:09 +00:00
jmmv dd2f8250cc 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.
2007-11-12 15:05:15 +00:00