summaryrefslogtreecommitdiff
path: root/src/tests/hs_tests.h
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2021-08-08 12:54:27 -0500
committersanine-a <sanine.not@pm.me>2021-08-08 12:54:27 -0500
commit732d80ce7e17f5a66e8e3f8c6c91b0de80dda1c4 (patch)
treeb01e826fb205c0bd0ae25fb66564e06b1e9d1b95 /src/tests/hs_tests.h
parent02df0b109a30ba20ab1782d7bd6cc38ad610a58f (diff)
simplify test suite macros
Diffstat (limited to 'src/tests/hs_tests.h')
-rw-r--r--src/tests/hs_tests.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tests/hs_tests.h b/src/tests/hs_tests.h
index e619f7c..3e1c98e 100644
--- a/src/tests/hs_tests.h
+++ b/src/tests/hs_tests.h
@@ -33,9 +33,12 @@
tests_failed++; \
} \
} while (0)
-#define mu_suite_start() tests_run_old = tests_run;
-#define mu_suite_finish() printf(mu_indent "ran %d tests\n", tests_run - tests_run_old);
#define TEST(name) static const char* name(lua_State *L)
+#define mu_run_suite(suite) do { \
+ tests_run_old = tests_run; \
+ suite(); \
+ printf(mu_indent "ran %d tests\n", tests_run - tests_run_old); \
+ } while (0)
extern int tests_run, tests_run_old, tests_failed;