You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
naka/include/tests.h

23 lines
469 B

#ifndef _TESTH_H
#define _TESTS_H
#include <stdio.h>
#include "macros.h"
/// Run a test before `main()`
#define RUNTEST(name) __attribute__((constructor)) void _runtest__ ## name () { \
fprintf(stderr, "[!] <--- running test " #name " --- \n"); \
CALLTEST(name); \
fprintf(stderr, "[!] --- " #name " ok --->\n"); \
}
#ifdef DEBUG
#define RUNTEST_DEBUG(name) RUNTEST(name)
#else
#define RUNTEST_DEBUG(name)
#endif
DEFTEST(version_str);
#endif /* _TESTS_H */