mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
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
This commit is contained in:
parent
02fe0e943a
commit
80aa766067
@ -124,8 +124,12 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const
|
|||||||
|
|
||||||
if (ts)
|
if (ts)
|
||||||
GETTIMEOFDAY(&before);
|
GETTIMEOFDAY(&before);
|
||||||
|
virResetLastError();
|
||||||
if ((ret = body(data)) != 0)
|
if ((ret = body(data)) != 0)
|
||||||
break;
|
break;
|
||||||
|
virErrorPtr err = virGetLastError();
|
||||||
|
if (err)
|
||||||
|
virDispatchError(NULL);
|
||||||
if (ts) {
|
if (ts) {
|
||||||
GETTIMEOFDAY(&after);
|
GETTIMEOFDAY(&after);
|
||||||
ts[i] = DIFF_MSEC(&after, &before);
|
ts[i] = DIFF_MSEC(&after, &before);
|
||||||
|
Loading…
Reference in New Issue
Block a user