diff options
author | EuAndreh <eu@euandre.org> | 2023-11-15 10:50:30 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-11-15 16:16:30 -0300 |
commit | af5e7495f3993c52573432cadde12169d5c05e62 (patch) | |
tree | 002fc20e6f12eac71c21c6eccc48bf59e7180274 /tests/tests-lib.c | |
parent | src/napi-sqlite.c: Add Node-API PoC (diff) | |
download | papod-af5e7495f3993c52573432cadde12169d5c05e62.tar.gz papod-af5e7495f3993c52573432cadde12169d5c05e62.tar.xz |
Add support for multi-file C project
- have dynamic discovered dependencies via `mkdeps.hs`, and also move
the listing of JavaScript files to it.
- copy over stub C files for setting up the project skeleton.
Diffstat (limited to 'tests/tests-lib.c')
-rw-r--r-- | tests/tests-lib.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/tests-lib.c b/tests/tests-lib.c new file mode 100644 index 0000000..e46fb2d --- /dev/null +++ b/tests/tests-lib.c @@ -0,0 +1,28 @@ +#include "tests-lib.h" +#include <stdio.h> +#include <assert.h> + +#define COLOUR_RESET "\033[0m" +#define COLOUR_GREEN "\033[0;32m" +#define COLOUR_YELLOW "\033[0;33m" + +void +test_start(const char *const name) { + assert(fprintf(stdout, "%s:\n", name) > 0); +} + +void +testing(const char *const message) { + assert( + fprintf( + stdout, + COLOUR_YELLOW "testing" COLOUR_RESET ": %s...", + message + ) > 0 + ); +} + +void +test_ok(void) { + assert(fprintf(stdout, " " COLOUR_GREEN "OK" COLOUR_RESET ".\n") > 0); +} |