Commit Graph

18 Commits

Author SHA1 Message Date
Enji Cooper
765086c5da Remove unused atf.test.mk variables
- ATF_BUILD_CC
- ATF_BUILD_CPP
- ATF_BUILD_CXX
- ATF_SHELL
- ATF_PREFIX

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-12-06 07:30:18 +00:00
Enji Cooper
61099d9aab Remove ALLOW_DEPRECATED_ATF_TOOLS/ATFFILE support from atf.test.mk
The legacy atf tools were removed in atf 0.20

MFC after: 2 weeks
2015-06-15 06:38:59 +00:00
Baptiste Daroussin
5551c57355 Rework PRIVATELIB
Now when a lib is marked as PRIVATELIB it is renamed into libprivate$foo instead
of being installed in /usr/lib/private and playing with rpath.

Also allow to install headers for PRIVATELIBS in that case the headers will be
installed in /usr/include/private/$foo

Keep the headers under a private namespace to prevent third party build system
to easily find them to ensure they are only used on purpose.

This allows for non base applications to statically link against a library in
base which is linked to a privatelib

Treating PRIVATELIBS as regular libraries allows to push them into our current
compatX packages if needed.

While here finish promotion of libevent as PRIVATELIB
Install header for bsdstat and libucl

Differential Revision:	https://reviews.freebsd.org/D2365
Reviewed by:	brooks, des
Discussed with:	imp
2015-05-04 16:28:54 +00:00
Enji Cooper
db572ab644 As an optimization (in simple, well used cases) only call cat ${.ALLSRC} when
generating files from various sources instead of calling cat ${.ALLSRC} | sed

The perl case was skipped because it's not being used in the tree at this time
2014-11-04 01:57:31 +00:00
Enji Cooper
eb1fef6574 Fix linking static test binaries with atf.test.mk
Check for -static in LDFLAGS or LDFLAGS.<test>, then pass in the appropriate
dependency (LIBATF or LDATF)

This unbreaks the build with some of the NetBSD tests that need to be compiled
statically

Reviewed by: imp, jmmv
Phabric: D991
Sponsored by: EMC / Isilon Storage Division
2014-10-22 18:11:10 +00:00
Baptiste Daroussin
d029c3aa25 Rework privatelib/internallib
Make sure everything linking to a privatelib and/or an internallib does it directly
from the OBJDIR rather than DESTDIR.
Add src.libnames.mk so bsd.libnames.mk is not polluted by libraries not existsing
in final installation
Introduce the LD* variable which is what ld(1) is expecting (via LDADD) to link to
internal/privatelib
Directly link to the .so in case of private library to avoid having to complexify
LDFLAGS.

Phabric:	https://phabric.freebsd.org/D553
Reviewed by:	imp, emaste
2014-08-06 22:17:26 +00:00
Julio Merino
64dc02450b Fix atf-sh's integration_test
With the move of atf-sh into /usr/libexec in r267181, some of the
tests in the integration_test program broke because they could not
execute atf-sh from the path any longer.

This slipped through because I do have a local atf installation in
my home directory that appears in my path, hence the tests could
still execute my own version.

Fix this by forcing /usr/libexec to appear at the beginning of the
path when attempting to execute atf-sh.

To make upgrading easy (and to avoid an unnecessary entry in UPDATING),
make integration_test depend on the Makefile so that a rebuild of the
shell script is triggered.  This requires a hack in the *.test.mk files
to ensure the Makefile is not treated as a source to the generated
program.  Ugly, I know, but I don't have a better way of doing this at
the moment.  Will think of one once I address the TODO in the *.test.mk
files that suggests generalizing the file generation functionality.

PR:		191052
Reviewed by:	Garrett Cooper
2014-07-09 00:55:50 +00:00
Julio Merino
8c7ec47a40 Move atf-sh from /usr/bin/ to /usr/libexec/
In r266650, we made libatf-c and libatf-c++ private libraries so that no
components outside of the source tree could unintendedly depend on them.

This change does the same for the "atf-sh library" by moving the atf-sh
interpreter from its public location in /usr/bin/ to the private location
in /usr/libexec/.  Our build system will ensure that our own test programs
use the right binary, but users won't be able to depend on atf-sh by
"mistake".

Committing this now to ride the UPDATING notice added with r267172 today.
2014-06-06 18:58:06 +00:00
Julio Merino
a845d42777 Add the *_TESTS_SH_SED_* functionality to atf.test.mk.
This exists already in plain.test.mk and tap.test.mk and should have been
added to atf.test.mk too when the feature was first introduced.

(It is probably time to address the related TODOs but I will do that
separately.)
2014-06-06 17:53:05 +00:00
Julio Merino
17a286a994 Change libatf-c and libatf-c++ to be private libraries.
We should not be leaking these interfaces to the outside world given
that it's much easier for third-party components to use the devel/atf
package from ports.

As a side-effect, we can also drop the ATF pkgconfig and aclocal files
from the base system.  Nothing in the base system needs these, and it
was quite ugly to have to get them installed only so that a few ports
could build.  The offending ports have been fixed to depend on
devel/atf explicitly.

Reviewed by:	bapt
2014-05-25 12:01:13 +00:00
Julio Merino
f5fd950e35 Make bsd.test.mk the only public mk fragment for the building of tests.
Change {atf,plain,tap}.test.mk to be internal implementation details of
bsd.test.mk.  Makefiles that build tests should now only include bsd.test.mk
and declaratively specify what they want to build, without worrying about
the internal implementation of the mk files.

The reason for this change is to permit building test programs of different
interfaces from a single directory, which is something I had a need for
while porting tests over from src/tools/regression/.

Additionally, this change makes it possible to perform some other requested
changes to bsd.test.mk in an easier manner.  Coming soon.
2014-03-14 08:56:19 +00:00
Julio Merino
4e6b339397 Remove registration of C++ test programs into PROGS.
C++ programs need to be added to PROGS_CXX, not PROGS, and the code was
actually doing both.  Just keep the registration into PROGS_CXX to
prevent possible obscure build problems.

Approved by:	rpaulo (mentor)
2013-11-18 12:44:05 +00:00
Rui Paulo
30cc088dc0 Plug atf-run into the 'test' target.
If atf-run exists in ATF_PREFIX and if ALLOW_DEPRECATED_ATF_TOOLS has
been set to yes, the test target is automatically defined to use it
for the execution of test programs.

Submitted by:	Julio Merino jmmv google.com
MFC after:	2 weeks
2013-10-19 06:51:34 +00:00
Rui Paulo
25b6a535fa Add the automatic generation of Kyuafile files.
These files are generated from bsd.test.mk because kyua is able to run
test programs implemented using different libraries/frameworks.  In
order to make this possible, this change also extends the various
*.test.mk file to explicitly indicate the interface of every test
program.

Submitted by:	Julio Merino jmmv google.com
MFC after:	2 weeks
2013-10-19 06:50:56 +00:00
Rui Paulo
26ea29af54 Add the automatic generation of Atffile files.
These are only used by the deprecated atf-run and atf-report tools.
Generating them is easy and provides a mechanism for people to
experiment with these tools if they wish.

But, because these tools and files are deprecated, doing this only
happens if the user has explicitly set ALLOW_DEPRECATED_ATF_TOOLS
to yes.

Submitted by:	Julio Merino jmmv google.com
MFC after:	2 weeks
2013-10-19 06:50:17 +00:00
Rui Paulo
d4a14c8563 Clearly split the logic to build ATF and plain tests apart.
This change introduces a new plain.test.mk file that provides the build
infrastructure to build test programs that don't use any framework.
Most of the code previously in bsd.test.mk moves to plain.test.mk and
atf.test.mk is extended with the missing pieces.

In doing so, this change pushes all test program building logic to the
various *.test.mk files instead of trying to reuse some tiny bits.
In fact, this attempt to reuse some definitions makes the code harder
to read and harder to extend.

The clear benefit of this is that the interface of bsd.test.mk is now
clearly delimited.

Submitted by:	Julio Merino jmmv google.com
MFC after:	2 weeks
2013-10-19 06:48:49 +00:00
Rui Paulo
ec0e2ac611 Remove most of the ATF tools and the _atf user.
This is necessary because ATF is deprecated and it will be replaced by Kyua.

Submitted by:	jmmv@netbsd.org
Reviewed by:	Garrett Cooper
Approved by:	re
2013-10-12 06:06:53 +00:00
Simon J. Gerraty
50c5d27b26 Enable ATF testing.
Submitted by:	Garrett Cooper
Approved by:	marcel (mentor)
2012-11-07 22:02:02 +00:00