wayland/tests/test-runner.h
Pekka Paalanen b1d4eb24c6 tests: fail build if NDEBUG is defined
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-04-19 12:14:19 +03:00

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