Rethink logging of test recipes
authorRichard Levitte <levitte@openssl.org>
Fri, 12 Feb 2016 17:16:23 +0000 (18:16 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 12 Feb 2016 19:56:46 +0000 (20:56 +0100)
commitb843cdb1054413b97739433fde7fa18496ab222f
treebccb444fdce438f7e08595e30156be60d3c18133
parent6faffd0ad23801dc540d3865bfd5bbb92e40c791
Rethink logging of test recipes

The logging that was performed in OpenSSL::Test was initially set up
as a means not to let messages that test programs write to STDERR get
displayed when a test isn't running in verbose mode.  However, the way
it was implemented, it meant that those messages were never displayed,
and you had to look in a test log.  This also meant that output to
STDERR and output to STDOUT got broken apart, which isn't optimal.

So, we remove the whole test log file implementation, and instead,
we're sending STDERR to the null device unless one of these conditions
apply:

- the test recipe already redirects stderr.  Just let it.
- the environment variable HARNESS_ACTIVE is undefined, meaning the
  recipe is run directly as a perl script instead of being harnessed
  by Test::Harness
- the environment variable HARNESS_VERBOSE is set.

Getting a full log of the tests now becomes as simple as this:

    HARNESS_VERBOSE=yes make test 2>&1 | tee tests.log

Reviewed-by: Rich Salz <rsalz@openssl.org>
test/testlib/OpenSSL/Test.pm