Bug 208131

Summary: make check doesn't use newly generated Kyuafile in /usr/obj
Product: Base System Reporter: John Baldwin <jhb>
Component: testsAssignee: Enji Cooper <ngie>
Status: Closed FIXED    
Severity: Affects Only Me CC: ngie
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description John Baldwin freebsd_committer freebsd_triage 2016-03-19 00:19:26 UTC
I'm adding a new test binary.  To test it I want to do 'make' and then 'make check' in the source tree with the new binary.  The first step works fine and builds the new test ok and generates a new Kyaufile in /usr/obj, etc.  However 'make check' wasn't running my new test.  After running 'make -n check' I can see that it is using the Kyuafile in /usr/tests, not the one I just built.
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2016-04-21 21:33:06 UTC
(In reply to John Baldwin from comment #0)

Agreed. The default behavior was likely backwards from a usability perspective :/..
Comment 2 Enji Cooper freebsd_committer freebsd_triage 2016-06-09 20:29:42 UTC
As helpful context for later... I discovered a simple case where this wouldn't work: if there were `FILES` that needed to be installed first, e.g. usr.sbin/nmtree/tests/, then  `make check` would fail if there were files that needed to be installed first.

brooks/jhb talked about this briefly with me, and there are some concerns that will potentially need to be handled in general using ${MAKEOBJDIRPREFIX}/... in ${LD_LIBRARY_PATH}, etc -- in particular we considered implementing "make buildenv" for tests, and I floated the idea of having a tool in tools/... for running make install DESTDIR=$(mktemp -d), then running the test binaries within that limited environment.

Either way, it was recommended that the information for the "make check" target be more visible to end-users, via build(7), the FreeBSD Test Suite wiki page, etc.

I'm going to mull over this a bit more and propose a solution after starting a discussion on -testing@.
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2017-11-05 20:50:41 UTC
Does as of r322511.