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:
Cole Robinson
2009-10-16 11:37:36 -04:00
parent f5ee422c58
commit 9710856b33
6 changed files with 42 additions and 19 deletions

View File

@@ -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) \