From 6daf0c2c31272539d624fa5077f5ae1e6388f2ee Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sun, 16 Apr 2017 15:41:57 -0400 Subject: test: use mini-test.c --- test/src/main.c | 36 +----------------------------------- test/src/test-common.h | 15 +-------------- test/src/test-list.h | 9 --------- 3 files changed, 2 insertions(+), 58 deletions(-) (limited to 'test/src') diff --git a/test/src/main.c b/test/src/main.c index e8a0351..a1c8550 100644 --- a/test/src/main.c +++ b/test/src/main.c @@ -1,36 +1,2 @@ -#include -#include -#include - #include "test-list.h" - -/* TODO(indutny): TAP */ - -#define TEST_SELECT(N) \ - if (strncmp(argv[1], #N, sizeof(#N) - 1) == 0) { \ - fprintf(stderr, "===== " #N " =====\n"); \ - TEST_FN(N)(); \ - return 0; \ - } - -/* TODO(indutny): fork and run */ - -#define TEST_RUN(N) \ - do { \ - fprintf(stderr, "===== " #N " =====\n"); \ - TEST_FN(N)(); \ - } while (0); - -int main(int argc, char** argv) { - if (argc == 2) { - TEST_ENUM(TEST_SELECT) - - return -1; - } - - TEST_ENUM(TEST_RUN) - - return 0; -} - -#undef TEST_SELECT +#include "mini/main.h" diff --git a/test/src/test-common.h b/test/src/test-common.h index 925a63d..b780c64 100644 --- a/test/src/test-common.h +++ b/test/src/test-common.h @@ -1,23 +1,10 @@ #ifndef TEST_SRC_TEST_COMMON_H_ #define TEST_SRC_TEST_COMMON_H_ -#include -#include -#include - #include "uv.h" #include "uv_link_t.h" #include "test-list.h" - -#define CHECK(VALUE, MESSAGE) \ - do { \ - if ((VALUE)) break; \ - fprintf(stderr, "Assertion failure: " #MESSAGE "\n"); \ - abort(); \ - } while (0) - -#define CHECK_EQ(A, B, MESSAGE) CHECK((A) == (B), MESSAGE) -#define CHECK_NE(A, B, MESSAGE) CHECK((A) != (B), MESSAGE) +#include "mini/test.h" #endif /* TEST_SRC_TEST_COMMON_H_ */ diff --git a/test/src/test-list.h b/test/src/test-list.h index abb7cda..b6f83ac 100644 --- a/test/src/test-list.h +++ b/test/src/test-list.h @@ -8,13 +8,4 @@ V(stop_read_on_error) \ V(strerror) \ -#define TEST_DECL(N) void test__##N(); - -TEST_ENUM(TEST_DECL) - -#undef TEST_DECL - -#define TEST_FN(N) test__##N -#define TEST_IMPL(N) void test__##N() - #endif /* TEST_SRC_TEST_LIST_H_ */ -- cgit 1.4.1-2-gfad0