Before this patch, the testsuite was noisy:
TEST: qemuargv2xmltest
........................................ 40
................20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument '-unknown', adding to the qemu namespace
20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument 'parameter', adding to the qemu namespace
. 57 OK
PASS: qemuargv2xmltest
It's not a real failure (which is why the test was completing
successfully), so much as an intentional warning to the user that use
of the qemu namespace has the potential for undefined effects that
leaked through the default logging behavior. After this patch series,
all tests can access any logged data, and this particular test can
explicitly check for the presence or absence of the warning, such that
the test output becomes:
TEST: qemuargv2xmltest
........................................ 40
................. 57 OK
PASS: qemuargv2xmltest
* tests/testutils.h (virtTestLogContentAndReset): New prototype.
* tests/testutils.c (struct virtTestLogData): New struct.
(virtTestLogOutput, virtTestLogClose, virtTestLogContentAndReset):
New functions.
(virtTestMain): Always capture log data emitted during tests.
* tests/qemuargv2xmltest.c (testCompareXMLToArgvHelper, mymain):
Use flag to mark which tests expect noisy stderr.
(testCompareXMLToArgvFiles): Add parameter to test whether stderr
was appropriately silent.
Only print out '.' for each test case, full test output can be
re-enabled with VIR_TEST_VERBOSE=1, or VIR_TEST_DEBUG=XXXX
Sample output now looks like
TEST: statstest
........................................ 40
................................... 75 OK
PASS: statstest
TEST: qparamtest
................................ 32 OK
PASS: qparamtest
TEST:
............ 12 OK
Provide a simple interface for other tests to lookup the testDebug variable.
Also remove a redundant error message in interface tests.
If anyone feels inclined to change this env variable to match the existing
LIBVIRT_* format, it should now be easier to do so.