From patchwork Tue Dec 3 15:09:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 3276981 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 17494C0D4A for ; Tue, 3 Dec 2013 15:10:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7795D20394 for ; Tue, 3 Dec 2013 15:10:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3BF7D2038E for ; Tue, 3 Dec 2013 15:10:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0F8FFB41D; Tue, 3 Dec 2013 07:10:17 -0800 (PST) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 4DF29FB41D for ; Tue, 3 Dec 2013 07:10:16 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 03 Dec 2013 07:10:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,818,1378882800"; d="scan'208";a="446060787" Received: from tursulin-linux.isw.intel.com ([10.102.226.168]) by orsmga002.jf.intel.com with ESMTP; 03 Dec 2013 07:10:14 -0800 From: tvrtko.ursulin@linux.intel.com To: Intel-gfx@lists.freedesktop.org Date: Tue, 3 Dec 2013 15:09:57 +0000 Message-Id: <1386083397-27634-1-git-send-email-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 1.8.4.3 Subject: [Intel-gfx] [PATCH] build: Make sure asserts are enabled for tests X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)