diff options
author | Fedor Indutny <fedor@indutny.com> | 2017-04-16 15:41:57 -0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2017-04-16 15:41:57 -0400 |
commit | 6daf0c2c31272539d624fa5077f5ae1e6388f2ee (patch) | |
tree | 6bf3a47cf1cea1ebc5452d5857ff5690ea4d3f53 /test/src | |
parent | 7e5885a2bd2f55f947b4a942d75354ad80c5f3a2 (diff) | |
download | uv_link_t-6daf0c2c31272539d624fa5077f5ae1e6388f2ee.tar.gz |
test: use mini-test.c
Diffstat (limited to 'test/src')
-rw-r--r-- | test/src/main.c | 36 | ||||
-rw-r--r-- | test/src/test-common.h | 15 | ||||
-rw-r--r-- | test/src/test-list.h | 9 |
3 files changed, 2 insertions, 58 deletions
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 <stdio.h> -#include <string.h> -#include <unistd.h> - #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 <stdio.h> -#include <stdlib.h> -#include <errno.h> - #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_ */ |