build: Make sure asserts are enabled for tests
PATCH 1/1 build: Make sure asserts are enabled for tests
From: Tvrtko Ursulin <[email protected]>
Tests depend on assertions being enabled since they can, and do, contain actual test steps. They are also mandatory for ensuring sane test case behaviour.
Signed-off-by Tvrtko Ursulin <[email protected]>
--- lib/check-ndebug.h | 3 +++ tests/Android.mk | 2 +- tests/Makefile.am | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 lib/check-ndebug.h
lib/check-ndebug.h new file +3 -0
@@ -0,0 +1,3 @@ +#ifdef NDEBUG +#error "Testsuite needs its asserts!" +#endif
tests/Android.mk +1 -1
@@ -40,7 +40,7 @@ define add_test $(LIBPCIACCESS_PATH)/include LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM - LOCAL_CFLAGS += -DANDROID + LOCAL_CFLAGS += -DANDROID -UNDEBUG -include "check-ndebug.h" LOCAL_CFLAGS += -std=c99 # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit LOCAL_CFLAGS += -Wno-error=return-type
tests/Makefile.am +1 -0
@@ -23,6 +23,7 @@ CLEANFILES = $(EXTRA_PROGRAMS) AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \ -I$(srcdir)/.. \ -I$(srcdir)/../lib \ + -include "check-ndebug.h" \ -DIGT_DATADIR=\""$(abs_srcdir)"\" \ $(NULL)
Signature · 1 line
1.8.4.3
Daniel Vetter
AppliedQuoted 7 lines · On Tue, Dec 03, 2013 at 03:09:57PM +0000, [email protected] wrote:
From: Tvrtko Ursulin <[email protected]>
Tests depend on assertions being enabled since they can, and do, contain actual test steps. They are also mandatory for ensuring sane test case behaviour.
Signed-off-by Tvrtko Ursulin <[email protected]>
Merged, thanks for the patch.
-Daniel
Quoted 44 lines
--- lib/check-ndebug.h | 3 +++ tests/Android.mk | 2 +- tests/Makefile.am | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 lib/check-ndebug.hlib/check-ndebug.h new file +3
-0@@ -0,0 +1,3 @@ +#ifdef NDEBUG +#error "Testsuite needs its asserts!" +#endif tests/Android.mk +1
-1@@ -40,7 +40,7 @@ define add_test $(LIBPCIACCESS_PATH)/include LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM - LOCAL_CFLAGS += -DANDROID + LOCAL_CFLAGS += -DANDROID -UNDEBUG -include "check-ndebug.h" LOCAL_CFLAGS += -std=c99 # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit LOCAL_CFLAGS += -Wno-error=return-typetests/Makefile.am +1
-0@@ -23,6 +23,7 @@ CLEANFILES = $(EXTRA_PROGRAMS) AM_CFLAGS = $(DRM_CFLAGS) $(CWARNFLAGS) \ -I$(srcdir)/.. \ -I$(srcdir)/../lib \ + -include "check-ndebug.h" \ -DIGT_DATADIR=\""$(abs_srcdir)"\" \ $(NULL)Signature · 1 line
1.8.4.3
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch