diff options
author | katherine <ageha@airen-no-jikken.icu> | 2019-06-14 18:48:19 -0700 |
---|---|---|
committer | katherine <ageha@airen-no-jikken.icu> | 2019-06-14 18:48:19 -0700 |
commit | cae280b3246a51cd485cb01c8ec73a205ceac7e8 (patch) | |
tree | 9d7be5298e0b1dcbcec041d45173496df7eec4c9 /README.md | |
parent | 1cc20f0b45a5dd053e344ba9b925eff721f21893 (diff) | |
download | simple-test-cae280b3246a51cd485cb01c8ec73a205ceac7e8.tar.gz |
add macro settings for colour and print fun
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -30,6 +30,13 @@ the following example file is available as [example.c](doc/example.c), which you can compile and play with yourself. ```C +/* SIMPLE_TEST_PRINT_FUN may be redefined like so. default is `printf` */ +#define stderr_redirect(...) fprintf(stderr, __VA_ARGS__) +#define SIMPLE_TEST_PRINT_FUN stderr_redirect + +/* colour output is on by default, but can be disabled */ +/* #define SIMPLE_TEST_USE_COLOUR false */ + #include "../simple-test.h" /* global variables, functions, and includes must come before BEGIN_TEST */ @@ -173,6 +180,8 @@ simple-test's interface consists of a series of preprocessor macros: | **NAME** | **DESCRIPTION** | |---------:|:----------------| +| **SIMPLE_TEST_USE_COLOUR** | may be defined, before the header is included, as either a `true` or `false` resolving expression. default is `true` | +| **SIMPLE_TEST_PRINT_FUN** | may be defined, before the header is included, as a function or macro which takes `printf` style arguments. default is `printf` | | **BEGIN_TEST** | must be included once, after includes and global declarations and before the first `TEST` statement | | **END_TEST** | must be included once, after the final `TEST` statement | | **TEST(description)**{} | declare a test, described by `description`, which consists of statements between the {} | |