From: Damien Lespiau Subject: [PATCH 2/8] lib: Introduce drmtest_skip_on_simulation() Date: Thu, 18 Jul 2013 16:19:07 +0100 Message-ID: <1374160753-21781-3-git-send-email-damien.lespiau@intel.com> References: <1374160753-21781-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id C6111E68E1 for ; Thu, 18 Jul 2013 08:19:30 -0700 (PDT) In-Reply-To: <1374160753-21781-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org This will allow us to explicitely blacklist tests we don't want to run on simulation. Signed-off-by: Damien Lespiau --- lib/drmtest.c | 12 ++++++++++++ lib/drmtest.h | 1 + 2 files changed, 13 insertions(+) diff --git a/lib/drmtest.c b/lib/drmtest.c index 76c84b1..a9a7498 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "drm_fourcc.h" #include "drmtest.h" @@ -709,6 +710,17 @@ bool drmtest_run_in_simulation(void) return simulation; } +/* Skip the test when running on simulation (and that's relevant only when + * we're not in the mode where we list the subtests) */ +void drmtest_skip_on_simulation(void) +{ + if (drmtest_only_list_subtests()) + return; + + if (drmtest_run_in_simulation()) + exit(77); +} + /* other helpers */ void drmtest_exchange_int(void *array, unsigned i, unsigned j) { diff --git a/lib/drmtest.h b/lib/drmtest.h index 5050a5d..c31fed1 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -95,6 +95,7 @@ bool drmtest_only_list_subtests(void); bool drmtest_run_in_simulation(void); #define SLOW_QUICK(slow,quick) (drmtest_run_in_simulation() ? (quick) : (slow)) +void drmtest_skip_on_simulation(void); /* helpers based upon the libdrm buffer manager */ void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr); -- 1.8.3.1