diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2013-12-03 15:09:57 +0000 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-12-03 17:08:03 +0100 |
commit | b92b397d5e4ffe10ed92fb2fc6711758ef5bcf89 (patch) | |
tree | a768e54e11fdb8916295a9c5b884a7c6fa6b3fd7 | |
parent | aee0dcb1ec2075991d310dd6f3fb5e50160847d1 (diff) |
build: Make sure asserts are enabled for tests
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 <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | lib/check-ndebug.h | 3 | ||||
-rw-r--r-- | tests/Android.mk | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/lib/check-ndebug.h b/lib/check-ndebug.h new file mode 100644 index 00000000..68a6ec4c --- /dev/null +++ b/lib/check-ndebug.h @@ -0,0 +1,3 @@ +#ifdef NDEBUG +#error "Testsuite needs its asserts!" +#endif diff --git a/tests/Android.mk b/tests/Android.mk index 1bd3d213..ec64acd8 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -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 diff --git a/tests/Makefile.am b/tests/Makefile.am index 8e293f75..b8cddd56 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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) |