b1d4eb24c6
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
24 lines
432 B
C
24 lines
432 B
C
#ifndef _TEST_RUNNER_H_
|
|
#define _TEST_RUNNER_H_
|
|
|
|
#ifdef NDEBUG
|
|
#error "Tests must not be built with NDEBUG defined, they rely on assert()."
|
|
#endif
|
|
|
|
struct test {
|
|
const char *name;
|
|
void (*run)(void);
|
|
};
|
|
|
|
#define TEST(name) \
|
|
static void name(void); \
|
|
\
|
|
const struct test test##name \
|
|
__attribute__ ((section ("test_section"))) = { \
|
|
#name, name \
|
|
}; \
|
|
\
|
|
static void name(void)
|
|
|
|
#endif
|