From 3e401bf652eadf39aed2dee250dfed6168760fce Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 8 Nov 2019 14:23:56 +0100 Subject: test: make build fail if NDEBUG is defined Defining NDEBUG via CFLAGS is the canonical way to disable assertions in C. mpv respects this (and ta.c actually disables some debugging machinery if it's defined). But for tests, this is not useful at all. So if --enable-tests is passed to configure, the user must not define NDEBUG, even if the rest of the player does not care. (We could just #undef NDEBUG, but let's not. Tests calling into the rest of the player might depend on asserts there, or so.) --- test/index.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/index.c b/test/index.c index c4ad10888f..4804cead2f 100644 --- a/test/index.c +++ b/test/index.c @@ -51,3 +51,7 @@ bool run_tests(struct MPContext *mpctx) return num_run > 0; // still error if none } + +#ifdef NDEBUG +static_assert(false, "don't define NDEBUG for tests"); +#endif -- cgit v1.2.3