Makefiles for skip-level directories?

Alan Somers asomers at
Thu Mar 27 22:52:30 UTC 2014

On Thu, Mar 27, 2014 at 4:25 PM, Peel, Casey <casey.peel at> wrote:
> We've created some ATF network tests in sys/net/, which involved creating the sys/net/tests directory and sys/net/tests/Makefile. There are currently no tests under sys/ at all. In order for that Makefile to get picked up by the build, I added sys/net/Makefile that looks like this:
> # $FreeBSD$
> .include <>
> .if ${MK_TESTS} != "no"
> SUBDIR+= tests
> .endif
> .include <>
> For that to get picked up, I added this to sys/Makefile before .include <>:
> .if ${MK_TESTS} != "no"
> SUBDIR+= net
> .endif
> My tests build and get installed correctly in /usr/tests:
> [root at system /usr/tests]# find sys
> sys
> sys/net
> sys/net/t_lagg_smoke
> sys/net/Kyuafile

What command are you using to build and install the tests?  It is
inappropriate to do this as part of buildkernel, because you could
have multiple kernel configs installed on one machine, each build with
different options.  But there's no way to install ATF tests for
different kernel configs.  I tried putting tests in sys/kern/tests and
building them with buildworld, but I had to hack up Makefile.inc1.

In a thread in January, we agreed not to put any tests in sys/.
Instead, we'll put them in tests/sys.  Take a look at
tests/sys/netinet; you can probably copy its structure for your tests.


More information about the freebsd-testing mailing list