Custom minimal unit testing header file. Inspired by http://www.jera.com/techinfo/jtns/jtn002.html. More...
Go to the source code of this file.
Macros | |
#define | mu_assert(message, test) |
Assert truth or return an error message. More... | |
#define | mu_assert_or_disconnect(bot, message, test) |
Same as mu_assert, but disconnects the bot before returning on failure. More... | |
#define | mu_run_test(name, test) |
Execute a test case. More... | |
Variables | |
int | tests_run |
Total number of tests executed. More... | |
int | tests_failed |
Number of tests that failed. More... | |
char ** | messages |
List of messages from failed tests, for printing. More... | |
ANSI color codes | |
Color codes or empty strings, determined by | |
char | RED [] |
char | GREEN [] |
char | YELLOW [] |
char | COLOR_END [] |
Custom minimal unit testing header file. Inspired by http://www.jera.com/techinfo/jtns/jtn002.html.
#define mu_assert | ( | message, | |
test | |||
) |
Assert truth or return an error message.
message | string to be returned on failure |
test | an expression that evaluates to 0 (false) or any other number (true) |
#define mu_assert_or_disconnect | ( | bot, | |
message, | |||
test | |||
) |
Same as mu_assert, but disconnects the bot before returning on failure.
bot | pointer to IRC_Bot |
message | string to be returned on failure |
test | an expression that evaluates to 0 (false) or any other number (true) |
#define mu_run_test | ( | name, | |
test | |||
) |
Execute a test case.
name | string containing the test name, can be anything |
test | function pointer to the test case |
char** messages |
List of messages from failed tests, for printing.
int tests_failed |
Number of tests that failed.
int tests_run |
Total number of tests executed.