test: Added definition to make default testing less verbose

TEST_VERBOSE is a preprocesser directive which TEST is dependent on.
By default it is 0, in which case TEST simply fails if the condition
is not true.  Otherwise, a full log (as done previously) is made.
This commit is contained in:
2026-02-05 05:16:11 +00:00
parent d88d7f7f23
commit 91264d96e4

View File

@@ -10,7 +10,12 @@
#include <alisp/alisp.h>
#ifndef TEST_VERBOSE
#define TEST_VERBOSE 0
#endif
#define TEST_PASSED() printf("\t[%s]: Passed\n", __func__)
#if TEST_VERBOSE
#define TEST(COND, ...) \
do \
{ \
@@ -30,6 +35,16 @@
assert(0); \
} \
} while (0)
#else
#define TEST(COND, ...) \
do \
{ \
if (!(COND)) \
{ \
assert(0); \
} \
} while (0)
#endif
typedef struct TestFn
{