mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: Centralize VIR_TEST_DEBUG lookup, and document it
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.
This commit is contained in:
@@ -25,7 +25,7 @@ static int testDevice(const char *path, int expect)
|
||||
if (actual == expect) {
|
||||
return 0;
|
||||
} else {
|
||||
if (getenv("DEBUG_TESTS"))
|
||||
if (virtTestGetDebug())
|
||||
fprintf(stderr, "Expect %-6d Actual %-6d\n", expect, actual);
|
||||
return -1;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ mymain(int argc ATTRIBUTE_UNUSED,
|
||||
* register a handler to stop error messages cluttering
|
||||
* up display
|
||||
*/
|
||||
if (!getenv("VIR_TEST_DEBUG"))
|
||||
if (!virtTestGetDebug())
|
||||
virSetErrorFunc(NULL, testQuietError);
|
||||
|
||||
#define DO_TEST(dev, num) \
|
||||
|
||||
Reference in New Issue
Block a user