2019-04-28 12:12:40 -05:00
|
|
|
// 28 april 2019
|
|
|
|
#include "../ui.h"
|
2019-05-04 15:53:54 -05:00
|
|
|
#include "lib/testing.h"
|
|
|
|
#include "lib/timer.h"
|
2019-04-28 12:12:40 -05:00
|
|
|
|
|
|
|
// main.c
|
2019-05-03 09:32:31 -05:00
|
|
|
extern void timeoutMain(void *data);
|
2019-05-03 01:02:20 -05:00
|
|
|
#define timeout_uiMain(t, d) { \
|
|
|
|
timerSysError err; \
|
|
|
|
int timedOut; \
|
|
|
|
err = timerRunWithTimeout(d, timeoutMain, NULL, &timedOut); \
|
|
|
|
if (err != 0) \
|
|
|
|
testingTErrorf(t, "error running uiMain() in timeout: " timerSysErrorFmt, timerSysErrorFmtArg(err)); \
|
|
|
|
if (timedOut) { \
|
|
|
|
char timeoutstr[timerDurationStringLen]; \
|
|
|
|
timerDurationString(d, timeoutstr); \
|
|
|
|
testingTErrorf(t, "uiMain() timed out (%s)", timeoutstr); \
|
|
|
|
} \
|
|
|
|
}
|