|
htils 1
A small set of utilities for C programming.
|
Go to the source code of this file.
Macros | |
| #define | COLOR_GREEN "\x1b[32m" |
| #define | COLOR_CYAN "\x1b[36m" |
| #define | COLOR_RED "\x1b[31m" |
| #define | COLOR_RESET "\x1b[0m" |
| #define | HTILS_TEST_ASSERT(cond, msg) |
Fail the test with msg when cond is false. | |
| #define | HTILS_TEST(name) |
| Declare a test. | |
| #define | HTILS_TEST_RUN(name) |
| Run a declared test. | |
| #define | HTILS_TEST_RESULT() |
| #define | HTILS_TEST_PASS null |
| Return value for a passing test. | |
| #define | HTILS_TEST_SKIP "@" |
| Return this from a test to mark it skipped. | |
| #define COLOR_CYAN "\x1b[36m" |
| #define COLOR_GREEN "\x1b[32m" |
| #define COLOR_RED "\x1b[31m" |
| #define COLOR_RESET "\x1b[0m" |
| #define HTILS_TEST | ( | name | ) |
Declare a test.
Expands to a static function htils_test_<name> taking an arena and returning its result (HTILS_TEST_PASS, or a failure message).
| #define HTILS_TEST_ASSERT | ( | cond, | |
| msg ) |
Fail the test with msg when cond is false.
| #define HTILS_TEST_PASS null |
Return value for a passing test.
| #define HTILS_TEST_RESULT | ( | ) |
Handle the test results, prints the results and returns 0 if all tests pass, returns 1 if any test fails.
| #define HTILS_TEST_RUN | ( | name | ) |
Run a declared test.
Runs name in a fresh temporary arena, printing PASS, FAIL, or SKIPPED. Expects the surrounding runner to have arena, test_count, skips, and failures in scope, and is meant to be paired with HTILS_TEST_RESULT().
| #define HTILS_TEST_SKIP "@" |
Return this from a test to mark it skipped.