aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2016-12-18 23:15:30 -0800
committerGarrett D'Amore <garrett@damore.org>2016-12-18 23:15:30 -0800
commit4847c64536a5c8be22051c93939034b308d1e717 (patch)
tree7a04a4676070b4f55ffa9c8dfc53bde4a7b9dff9
parentb73794d8cd48804685248f6f7d57b831841bd620 (diff)
downloadnng-4847c64536a5c8be22051c93939034b308d1e717.tar.gz
nng-4847c64536a5c8be22051c93939034b308d1e717.tar.bz2
nng-4847c64536a5c8be22051c93939034b308d1e717.zip
test_main in terms of test_main_group and test_group.
-rw-r--r--tests/test.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/tests/test.h b/tests/test.h
index 28e13572..06cd1e29 100644
--- a/tests/test.h
+++ b/tests/test.h
@@ -121,21 +121,6 @@ extern void test_i_fatal(const char *, int, const char *);
} while (0)
/*
- * test_main is used to wrap the top-level of your test suite, and is
- * used in lieu of a normal main() function. This is the usual case where
- * the executable only contains a single top level test group.
- */
-#define test_main(T_name, T_code) \
- int test_main_impl(void) { \
- int T_rv; \
- test_i_run(T_name, T_code, &T_rv); \
- return (T_rv); \
- } \
- int main(int argc, char **argv) { \
- return (test_i_main(argc, argv)); \
- }
-
-/*
* If you want multiple top-level tests in your test suite, the test
* code should create a test_main_group(), with multiple calls to
* test_group() in the intervening section. This will cause a new main
@@ -163,6 +148,17 @@ extern void test_i_fatal(const char *, int, const char *);
} while (0)
/*
+ * test_main is used to wrap the top-level of your test suite, and is
+ * used in lieu of a normal main() function. This is the usual case where
+ * the executable only contains a single top level test group.
+ */
+#define test_main(T_name, T_code) \
+ test_main_group({ \
+ test_group(T_name, T_code); \
+ })
+
+
+/*
* If you don't want to use the test framework's main routine, but
* prefer (or need, because of threading for example) to have your
* test code driven separately, you can use inject test_block() in