about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--package.json3
-rw-r--r--test/src/main.c36
-rw-r--r--test/src/test-common.h15
-rw-r--r--test/src/test-list.h9
-rw-r--r--uv_link_t.gyp13
5 files changed, 14 insertions, 62 deletions
diff --git a/package.json b/package.json
index 80e8da5..d1fcbac 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,8 @@
   "private": true,
   "keywords": [],
   "scripts": {
-    "test": "make test"
+    "build": "gypkg build uv_link_t.gyp",
+    "test": "npm run build && ./out/Release/uv_link_t-test"
   },
   "author": "Fedor Indutny <fedor@indutny.com>",
   "license": "MIT",
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_ */
diff --git a/uv_link_t.gyp b/uv_link_t.gyp
index 1f6294c..71743f8 100644
--- a/uv_link_t.gyp
+++ b/uv_link_t.gyp
@@ -1,8 +1,8 @@
 {
   "variables": {
-      "gypkg_deps": [
-        "git://github.com/libuv/libuv.git@^1.9.0 => uv.gyp:libuv",
-      ],
+    "gypkg_deps": [
+      "git://github.com/libuv/libuv.git@^1.9.0 => uv.gyp:libuv",
+    ],
   },
 
   "targets": [{
@@ -35,6 +35,13 @@
       "test/src"
     ],
 
+    "variables": {
+      "gypkg_deps": [
+        "git://github.com/libuv/libuv.git@^1.9.0 => uv.gyp:libuv",
+        "git://github.com/indutny/mini-test.c.git#master => mini-test.gyp:mini-test",
+      ],
+    },
+
     "dependencies": [
       "<!@(gypkg deps <(gypkg_deps))",
       "uv_link_t",