mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
tests: add option to disable colors in test output
* because some terminals may not support colors, in that case, colors can be disabled by defining `GLM_TESTS_NO_COLORFUL_OUTPUT`
This commit is contained in:
@@ -38,6 +38,8 @@ typedef struct test_entry_t {
|
|||||||
int show_output;
|
int show_output;
|
||||||
} test_entry_t;
|
} test_entry_t;
|
||||||
|
|
||||||
|
#ifndef GLM_TESTS_NO_COLORFUL_OUTPUT
|
||||||
|
|
||||||
#define RESET "\033[0m"
|
#define RESET "\033[0m"
|
||||||
#define BLACK "\033[30m" /* Black */
|
#define BLACK "\033[30m" /* Black */
|
||||||
#define RED "\033[31m" /* Red */
|
#define RED "\033[31m" /* Red */
|
||||||
@@ -56,6 +58,28 @@ typedef struct test_entry_t {
|
|||||||
#define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */
|
#define BOLDCYAN "\033[1m\033[36m" /* Bold Cyan */
|
||||||
#define BOLDWHITE "\033[1m\033[37m" /* Bold White */
|
#define BOLDWHITE "\033[1m\033[37m" /* Bold White */
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define RESET
|
||||||
|
#define BLACK
|
||||||
|
#define RED
|
||||||
|
#define GREEN
|
||||||
|
#define YELLOW
|
||||||
|
#define BLUE
|
||||||
|
#define MAGENTA
|
||||||
|
#define CYAN
|
||||||
|
#define WHITE
|
||||||
|
#define BOLDBLACK
|
||||||
|
#define BOLDRED
|
||||||
|
#define BOLDGREEN
|
||||||
|
#define BOLDYELLOW
|
||||||
|
#define BOLDBLUE
|
||||||
|
#define BOLDMAGENTA
|
||||||
|
#define BOLDCYAN
|
||||||
|
#define BOLDWHITE
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#define TEST_DECLARE(FUN) test_status_t test_ ## FUN(void);
|
#define TEST_DECLARE(FUN) test_status_t test_ ## FUN(void);
|
||||||
#define TEST_ENTRY(FUN) { #FUN, test_ ## FUN, 0, 0 },
|
#define TEST_ENTRY(FUN) { #FUN, test_ ## FUN, 0, 0 },
|
||||||
#define TEST_LIST static test_entry_t tests[] =
|
#define TEST_LIST static test_entry_t tests[] =
|
||||||
|
|||||||
Reference in New Issue
Block a user