mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +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)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user