mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
tests: silence qemuargv2xmltest noise
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.
This commit is contained in:
1 parent
10c592801c
commit
9e3525df86
3 files changed
+62
-5
No files matched your search
+3
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* utils.c: test utils
|
||||
*
|
||||
* Copyright (C) 2005, 2008-2009 Red Hat, Inc.
|
||||
* Copyright (C) 2005, 2008-2010 Red Hat, Inc.
|
||||
*
|
||||
* See COPYING.LIB for the License of this software
|
||||
*
|
||||
@@ -40,6 +40,8 @@ int virtTestDifference(FILE *stream,
|
||||
unsigned int virTestGetDebug(void);
|
||||
unsigned int virTestGetVerbose(void);
|
||||
|
||||
char *virtTestLogContentAndReset(void);
|
||||
|
||||
int virtTestMain(int argc,
|
||||
char **argv,
|
||||
int (*func)(int, char **));
|
||||
|
||||
Reference in new issue
Block a user