testlib: improve test target handling
commit9cd113449c84805de395da0c930c948055cd349a
authorKyle J. McKay <mackyle@gmail.com>
Sat, 17 Jun 2017 11:05:36 +0000 (17 04:05 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 17 Jun 2017 11:05:36 +0000 (17 04:05 -0700)
treedcf3353d5b91553f312f6b1c0749603b72b71c56
parent1931172da5b3f8a880cccb4ff8838da6bab7ced7
testlib: improve test target handling

Insert strategic 'set -m' calls to make sure there are sane process group
boundaries even when using deficient make implementations that do not
create such themselves.

Improve the handling of TESTLIB_TEST_PARENT_INT_ON_ERROR for the test
target so that the intended signalling is completed while avoiding permature
apoptosis in the process.

Originally the intent was that if a test "bailed out", then no aggregated
results would be shown.  However, detecting that condition via an exit
code turns out to be unreliable.  Therefore remove that check.

But preventing display of the aggregate results when a "Bail out!" occurs
helps bring the "Bail out!" condition to one's attention.  Therefore
replace the check with a test for a "test-results/bailout" file that gets
a copy of the "Bail out!" message whenever such occurs.

The aggregate results are now always suppressed for "Bail out!" conditions
and even the "prove" target benefits by leaving behind a copy of the actual
"Bail out!" failure for later inspection if desired.

Also take this opportunity to correct incorrect quoting usage in Makefile.mak
leftover from the gnomake conversion.  The old convention was to have _SQ
make variables that were to be always expanded inside single quotes but that
makes for some ugly accidents when those are forgotten.  Instead the
surrounding single quotes are now always included in the _SQ make variables
but that also means if those variables happen to be empty you get no argument
at all instead of an empty argument.  Therefore after removing the ugly
surrounding single quotes whereever _SQ make variables are expanded, add back
an ugly pair of trailing single quotes if the expansion is isolated AND is
not intended to vanish when empty.

Finally, since we're fixing things up, accomodate poorly implemented makes
that produce "error expanding embedded variable" messages when using a
calculated variable name and one of the embedded variables to expand has
actually never been set at all (this can happen with DEFAULT_TEST_TARGET).

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
t/Makefile.mak
t/test-lib-main.sh