mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
tests: Fix dispatching internal error reports
Without this fix, the test suite doesn't print error messages when a libvirt function fails. Additionally, only print error reports if DEBUG or VERBOSE requested.
This commit is contained in:
parent
149c492137
commit
b2399b06c5
@ -126,12 +126,19 @@ virtTestRun(const char *title, int nloops, int (*body)(const void *data), const
|
|||||||
|
|
||||||
if (ts)
|
if (ts)
|
||||||
GETTIMEOFDAY(&before);
|
GETTIMEOFDAY(&before);
|
||||||
|
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
if ((ret = body(data)) != 0)
|
ret = body(data);
|
||||||
break;
|
|
||||||
virErrorPtr err = virGetLastError();
|
virErrorPtr err = virGetLastError();
|
||||||
if (err)
|
if (err) {
|
||||||
|
if (virTestGetVerbose() || virTestGetDebug())
|
||||||
virDispatchError(NULL);
|
virDispatchError(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (ts) {
|
if (ts) {
|
||||||
GETTIMEOFDAY(&after);
|
GETTIMEOFDAY(&after);
|
||||||
ts[i] = DIFF_MSEC(&after, &before);
|
ts[i] = DIFF_MSEC(&after, &before);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user