From 034d5c965ff34cfdf4b153af9f32360a02e35684 Mon Sep 17 00:00:00 2001 From: sanine Date: Tue, 14 Jun 2022 00:05:58 -0500 Subject: scorched earth, start over --- src/test/minunit.h | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 src/test/minunit.h (limited to 'src/test/minunit.h') diff --git a/src/test/minunit.h b/src/test/minunit.h deleted file mode 100644 index 1a418c0..0000000 --- a/src/test/minunit.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef MINUNIT_H -#define MINUNIT_H - -#include -#include - -#define UNIT_TEST - -#define STR_IMPL(x) #x -#define STR(x) STR_IMPL(x) - -#define MU_INDENT " " - -/* minunit testing macros from /www.jera.com/techinfo/jtns/jtn002.html */ -#define mu_assert(test, message) do { if (!(test)) return message "\n" MU_INDENT " [" __FILE__ ":" STR(__LINE__) "]"; } while (0) -#define mu_assert_equal(a, b) mu_assert(a == b, "'" #a "' is not equal to '" #b "'") -#define mu_assert_unequal(a, b) mu_assert(a != b, "'" #a "' is equal to '" #b "'") -#define mu_assert_streq(a, b) mu_assert(strcmp(a, b) == 0, "'" #a "' is not equal to '" #b "'") - -#define mu_run_test(name, test) do { \ - const char *message = test(); \ - tests_run++; \ - if (message) { \ - printf(MU_INDENT "test '%s' failed: %s\n", name, message); \ - tests_failed++; \ - } \ - } while (0) -#define mu_run_suite(suite) do { \ - int run_old = tests_run; \ - int failed_old = tests_failed; \ - printf("suite: " #suite "\n"); \ - suite(); \ - printf(MU_INDENT "ran %d tests, %d failed\n\n", \ - tests_run - run_old, \ - tests_failed - failed_old); \ - } while(0) -#define mu_tests_finished() do { \ - printf("ran %d tests, %d failed\n", tests_run, tests_failed); \ - return tests_failed; \ - } while(0) - -#define mu_test const char * - -extern int tests_run, tests_failed; - -#endif -- cgit v1.2.1