More initmain.c integration. I think we're now complete to what it used to be for that one file. Now I have to figure out how to readd subtests...
This commit is contained in:
parent
7bb67c3e46
commit
8b400f33f7
|
@ -52,6 +52,7 @@ TODO if I remove the uiQuit() from this test on Windows, I will occasionally get
|
||||||
=== RUN TestQueueMain_DifferentThread
|
=== RUN TestQueueMain_DifferentThread
|
||||||
../test/initmain.c:161: uiMain() timed out (5s)
|
../test/initmain.c:161: uiMain() timed out (5s)
|
||||||
--- FAIL: TestQueueMain_DifferentThread (4.9989539s)
|
--- FAIL: TestQueueMain_DifferentThread (4.9989539s)
|
||||||
|
TODO see if this is still relevant
|
||||||
*/
|
*/
|
||||||
static void queued(void *data)
|
static void queued(void *data)
|
||||||
{
|
{
|
||||||
|
@ -111,7 +112,6 @@ static void queueOrder(struct testParams *p)
|
||||||
uiQueueMain(done, NULL);
|
uiQueueMain(done, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO also actually handle file and line again
|
|
||||||
static void checkOrderFull(const char *file, long line, uint32_t flag)
|
static void checkOrderFull(const char *file, long line, uint32_t flag)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -120,12 +120,12 @@ static void checkOrderFull(const char *file, long line, uint32_t flag)
|
||||||
return;
|
return;
|
||||||
for (i = 1; i < 6; i++)
|
for (i = 1; i < 6; i++)
|
||||||
if (flag == orders[i].result) {
|
if (flag == orders[i].result) {
|
||||||
TestErrorf("wrong order:" diff("%" PRIu32 " (%s)"),
|
TestErrorfFull(file, line, "wrong order:" diff("%" PRIu32 " (%s)"),
|
||||||
flag, orders[i].order,
|
flag, orders[i].order,
|
||||||
orders[0].result, orders[0].order);
|
orders[0].result, orders[0].order);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TestErrorf("wrong result:" diff("%" PRIu32 " (%s)"),
|
TestErrorfFull(file, line, "wrong result:" diff("%" PRIu32 " (%s)"),
|
||||||
flag, "unknown order",
|
flag, "unknown order",
|
||||||
orders[0].result, orders[0].order);
|
orders[0].result, orders[0].order);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,13 +71,20 @@ extern void TestSkipNow(void);
|
||||||
|
|
||||||
#define TestLogf(...) \
|
#define TestLogf(...) \
|
||||||
(testingprivLogfFullThen(stdout, NULL, __FILE__, __LINE__, __VA_ARGS__))
|
(testingprivLogfFullThen(stdout, NULL, __FILE__, __LINE__, __VA_ARGS__))
|
||||||
|
#define TestLogfFull(f, n, ...) \
|
||||||
|
(testingprivLogfFullThen(stdout, NULL, f, n, __VA_ARGS__))
|
||||||
#define TestErrorf(...) \
|
#define TestErrorf(...) \
|
||||||
(testingprivLogfFullThen(stderr, TestFail, __FILE__, __LINE__, __VA_ARGS__))
|
(testingprivLogfFullThen(stderr, TestFail, __FILE__, __LINE__, __VA_ARGS__))
|
||||||
|
#define TestErrorfFull(f, n, ...) \
|
||||||
|
(testingprivLogfFullThen(stderr, TestFail, f, n, __VA_ARGS__))
|
||||||
#define TestFatalf(...) \
|
#define TestFatalf(...) \
|
||||||
(testingprivLogfFullThen(stderr, TestFailNow, __FILE__, __LINE__, __VA_ARGS__))
|
(testingprivLogfFullThen(stderr, TestFailNow, __FILE__, __LINE__, __VA_ARGS__))
|
||||||
|
#define TestFatalfFull(f, n, ...) \
|
||||||
|
(testingprivLogfFullThen(stderr, TestFailNow, f, n, __VA_ARGS__))
|
||||||
// TODO remember if this needs to go to stdout or to stderr
|
// TODO remember if this needs to go to stdout or to stderr
|
||||||
#define TestSkipf(...) \
|
#define TestSkipf(...) \
|
||||||
(testingprivLogfFullThen(stderr, TestSkipNow, __FILE__, __LINE__, __VA_ARGS__))
|
(testingprivLogfFullThen(stderr, TestSkipNow, __FILE__, __LINE__, __VA_ARGS__))
|
||||||
|
// TODO TestSkipfFull (after resolving above TODO)
|
||||||
|
|
||||||
extern void testingprivRegisterTest(const char *name, void (*f)(void));
|
extern void testingprivRegisterTest(const char *name, void (*f)(void));
|
||||||
#include "../sharedbits/printfwarn_header.h"
|
#include "../sharedbits/printfwarn_header.h"
|
||||||
|
|
Loading…
Reference in New Issue