diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2010-09-08 17:12:42 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2010-10-13 16:45:31 +0100 |
commit | 80aa766067cf6da9c40ddda645d60211fd098a3d (patch) | |
tree | ccd9b376364e68c2c00f7f63d3d80a69d083b4e9 /tests/testutils.c | |
parent | Update todo list file to point at bugzilla/website (diff) | |
download | libvirt-80aa766067cf6da9c40ddda645d60211fd098a3d.tar.gz libvirt-80aa766067cf6da9c40ddda645d60211fd098a3d.tar.bz2 libvirt-80aa766067cf6da9c40ddda645d60211fd098a3d.zip |
Improve error reporting in test suites
Before running each test case clear the thread local error
indicator. After running each test case, dispatch any error
that was reported
* tests/testutils.c: Fix error reporting in test suites
Diffstat (limited to 'tests/testutils.c')
-rw-r--r-- | tests/testutils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/testutils.c b/tests/testutils.c index 8171f103b..70e7538f7 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -124,8 +124,12 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const if (ts) GETTIMEOFDAY(&before); + virResetLastError(); if ((ret = body(data)) != 0) break; + virErrorPtr err = virGetLastError(); + if (err) + virDispatchError(NULL); if (ts) { GETTIMEOFDAY(&after); ts[i] = DIFF_MSEC(&after, &before); |