libui/test/test.h

20 lines
554 B
C

// 28 april 2019
#include "../ui.h"
#include "testing.h"
#include "timer.h"
// main.c
extern void timeoutMain(void *data);
#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); \
} \
}