libui/test/test.h

20 lines
554 B
C
Raw Normal View History

// 28 april 2019
#include "../ui.h"
#include "testing.h"
2019-05-02 21:03:57 -05:00
#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); \
} \
}