From e986713657bc5f9880e91ed49dd9b0d0227f048d Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 17 Jun 2024 17:39:06 +0200 Subject: Use callback function to log to stderr --- test/test.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/test.h') diff --git a/test/test.h b/test/test.h index 1bbb9fc..415e093 100644 --- a/test/test.h +++ b/test/test.h @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -24,3 +25,15 @@ bool issolvable(cube_t); bool issolved(cube_t); cube_t readcube(char *, char *); void writecube(char *, cube_t, char *); +void nissy_setlogger(void (*logger_function)(const char *, va_list)); + +/* Test function to be implemented by all tests */ +void run(void); + +void log_stderr(const char *str, va_list vl) { vfprintf(stderr, str, vl); } + +int main(void) { + nissy_setlogger(log_stderr); + run(); + return 0; +} -- cgit v1.3