From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] build: Make sure asserts are enabled for tests Date: Tue, 3 Dec 2013 17:23:43 +0100 Message-ID: <20131203162343.GF27344@phenom.ffwll.local> References: <1386083397-27634-1-git-send-email-tvrtko.ursulin@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f169.google.com (mail-ea0-f169.google.com [209.85.215.169]) by gabe.freedesktop.org (Postfix) with ESMTP id E46C1FA27A for ; Tue, 3 Dec 2013 08:22:59 -0800 (PST) Received: by mail-ea0-f169.google.com with SMTP id l9so10005398eaj.14 for ; Tue, 03 Dec 2013 08:22:57 -0800 (PST) Content-Disposition: inline In-Reply-To: <1386083397-27634-1-git-send-email-tvrtko.ursulin@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: tvrtko.ursulin@linux.intel.com Cc: Intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Dec 03, 2013 at 03:09:57PM +0000, tvrtko.ursulin@linux.intel.com wrote: > From: Tvrtko Ursulin > > 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 Merged, thanks for the patch. -Daniel > --- > 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 > > diff --git a/lib/check-ndebug.h b/lib/check-ndebug.h > new file mode 100644 > index 0000000..68a6ec4 > --- /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 1bd3d21..ec64acd 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 8e293f7..b8cddd5 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) > > -- > 1.8.4.3 > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch