2019-04-28 12:12:40 -05:00
|
|
|
// 28 april 2019
|
|
|
|
#include "../ui.h"
|
2019-05-26 14:41:22 -05:00
|
|
|
#include "../common/testhooks.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
|
|
|
|
2019-05-26 14:08:51 -05:00
|
|
|
// TODO this should have the case reports indented
|
2019-05-04 20:13:47 -05:00
|
|
|
#define diff(t, clause, fmt, got, want) testingTErrorf(t, "%s:\ngot " fmt "\nwant " fmt, clause, got, want)
|
2019-05-18 20:21:35 -05:00
|
|
|
#define diff_2str(t, clause, clause2, fmt, got, want) testingTErrorf(t, "%s %s:\ngot " fmt "\nwant " fmt, clause, clause2, got, want)
|
2019-05-04 20:13:47 -05:00
|
|
|
#define diff2(t, clause, fmts, got1, got2, want1, want2) testingTErrorf(t, "%s:\ngot " fmts "\nwant " fmts, clause, got1, got2, want1, want2)
|
|
|
|
#define diffFatal(t, clause, fmt, got, want) testingTFatalf(t, "%s:\ngot " fmt "\nwant " fmt, clause, got, want)
|
|
|
|
#define diff2Fatal(t, clause, fmts, got1, got2, want1, want2) testingTFatalf(t, "%s:\ngot " fmts "\nwant " fmts, clause, got1, got2, want1, want2)
|
|
|
|
|
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); \
|
|
|
|
} \
|
|
|
|
}
|
2019-05-10 20:16:29 -05:00
|
|
|
|
|
|
|
// init.c
|
|
|
|
extern testingSet *beforeTests;
|