libtest: display the times after a test timeout error
This is to help with test failure debugging. Ref: #11328 Closes #11329
This commit is contained in:
parent
39c234c429
commit
2c5c7abb15
@ -440,12 +440,14 @@ extern int unitfail;
|
|||||||
tv_test_start = tutil_tvnow(); \
|
tv_test_start = tutil_tvnow(); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define exe_test_timedout(Y,Z) do { \
|
#define exe_test_timedout(Y,Z) do { \
|
||||||
if(tutil_tvdiff(tutil_tvnow(), tv_test_start) > TEST_HANG_TIMEOUT) { \
|
long timediff = tutil_tvdiff(tutil_tvnow(), tv_test_start); \
|
||||||
fprintf(stderr, "%s:%d ABORTING TEST, since it seems " \
|
if(timediff > (TEST_HANG_TIMEOUT)) { \
|
||||||
"that it would have run forever.\n", (Y), (Z)); \
|
fprintf(stderr, "%s:%d ABORTING TEST, since it seems " \
|
||||||
res = TEST_ERR_RUNS_FOREVER; \
|
"that it would have run forever (%ld ms > %ld ms)\n", \
|
||||||
} \
|
(Y), (Z), timediff, (long) (TEST_HANG_TIMEOUT)); \
|
||||||
|
res = TEST_ERR_RUNS_FOREVER; \
|
||||||
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define res_test_timedout() \
|
#define res_test_timedout() \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user