From cae280b3246a51cd485cb01c8ec73a205ceac7e8 Mon Sep 17 00:00:00 2001 From: katherine Date: Fri, 14 Jun 2019 18:48:19 -0700 Subject: add macro settings for colour and print fun --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index d9e7d61..0fffdc3 100644 --- a/README.md +++ b/README.md @@ -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 {} | -- cgit v1.2.3