aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2009-10-16 11:37:36 -0400
committerCole Robinson <crobinso@redhat.com>2009-10-20 14:17:34 -0400
commit9710856b3316328c7b3ba6d3264f67c1f5d710e4 (patch)
tree0e16523e9517c532d87e3f62c5a05c73459229b3 /tests/statstest.c
parenttests: Initialize virRandom in for test suite. (diff)
downloadlibvirt-9710856b3316328c7b3ba6d3264f67c1f5d710e4.tar.gz
libvirt-9710856b3316328c7b3ba6d3264f67c1f5d710e4.tar.bz2
libvirt-9710856b3316328c7b3ba6d3264f67c1f5d710e4.zip
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.
Diffstat (limited to 'tests/statstest.c')
-rw-r--r--tests/statstest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/statstest.c b/tests/statstest.c
index 82c0daa39..4c2ea7ffd 100644
--- a/tests/statstest.c
+++ b/tests/statstest.c
@@ -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) \