ATF config variables for FreeBSD tests

Julio Merino jmmv at freebsd.org
Thu Mar 20 23:44:54 UTC 2014


On Tue, Mar 18, 2014 at 12:14 AM, Alan Somers <asomers at freebsd.org> wrote:
> On Sun, Mar 16, 2014 at 10:53 AM, Garrett Cooper <yaneurabeya at gmail.com> wrote:
>> /usr/tests/libexec seems logical..
>
> But that's where tests for the stuff in /libexec go.  If anything, I
> think /usr/libexec/tests would be more appropriate.  Unfortunately,
> such files would share the same source location as the tests for the
> stuff in /libexec.  But I think it's preferable to have a confusing
> source layout to a confusing installed layout.

Indeed. But if this is shared supporting code, there is no reason for
it to live under /usr/tests. After all, the ATF libraries are not
installed inside /usr/tests and do not live in src/tests/!

For C, we'd just have a libfreebsd_tests.so or similar under
/usr/lib/private and put the source under src/lib/ (and its tests --of
course!-- under /usr/tests/lib/private/libfreebsd_tests/).

For shell, it depends on how the "libraries" look like. One option is
to have some installed .sh files that get sourced at runtime within
the script; the other is to just concatenate the helper code to the
test programs at build time and not install the library. In the former
case, we'd just install this under /usr/libexec/something; in the
latter, there is nothing to install. (There is also the option that
these shell libraries are actually separate binaries, of course, but
then the libexec layout also applies.)

And if we are concerned about the code looking like actual tests,
you'd always use .subr instead of .sh for supporting code as is done
in some other places (e.g. rc.subr).


More information about the freebsd-testing mailing list