提交 80aa7660 编写于 作者: D Daniel P. Berrange

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
上级 02fe0e94
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册