From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 08/10] lib: Introduce drmtest_skip_on_simulation() Date: Mon, 29 Apr 2013 16:00:31 -0700 Message-ID: <20130429160031.07639033@jbarnes-desktop> References: <1367259337-14586-1-git-send-email-damien.lespiau@intel.com> <1367259337-14586-9-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 oproxy13-pub.unifiedlayer.com (oproxy13-pub.unifiedlayer.com [69.89.16.30]) by gabe.freedesktop.org (Postfix) with SMTP id C0C70E5C82 for ; Mon, 29 Apr 2013 15:59:54 -0700 (PDT) In-Reply-To: <1367259337-14586-9-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: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, 29 Apr 2013 19:15:35 +0100 Damien Lespiau wrote: > 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 6e5b636..cafc8bc 100644 > --- a/lib/drmtest.c > +++ b/lib/drmtest.c > @@ -38,6 +38,7 @@ > #include > #include > #include > +#include > > #include "drmtest.h" > #include "i915_drm.h" > @@ -612,6 +613,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 71d68c4..96dddda 100644 > --- a/lib/drmtest.h > +++ b/lib/drmtest.h > @@ -91,6 +91,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); So if we're shooting for a real test suite in the end, this seems like the wrong way to go. Rather we should be pulling boilerplate *out* of each test (like open_any, sanity checks for ppgtt or whatever) and making each test tiny. Then we could have lists of tests in a separate file, complete with parameters, that would define specific areas of interest or things to run. I'm hoping that wouldn't get in the way of running individual tests easily, but I don't think it would if we did it right... -- Jesse Barnes, Intel Open Source Technology Center