GenSVM
|
Minimal unit testing framework for C. More...
Go to the source code of this file.
Macros | |
#define | mu_suite_start() char *message = NULL |
#define | mu_assert(test, message) if (!(test)) { log_err(message); return message; } |
#define | mu_run_test(test) |
#define | RUN_TESTS(name) |
#define | mu_test_missing() |
Variables | |
int | tests_run |
Minimal unit testing framework for C.
This unit testing framework comes from Zed Shaw's book Learn C The Hard Way, and are evolved from the "minunit" code snippets by Jera Design. I've added a mu_test_missing() macro to deal with missing unit tests.
Definition in file minunit.h.
#define mu_assert | ( | test, | |
message | |||
) | if (!(test)) { log_err(message); return message; } |
#define mu_run_test | ( | test | ) |
Run a test function, return the message if there is one, increment tests_run
#define mu_suite_start | ( | ) | char *message = NULL |
#define mu_test_missing | ( | ) |
#define RUN_TESTS | ( | name | ) |
Definition of main function for the test framework. Defines the output presented to stdout/stderr and runs all_tests function provided by "name"