From: Jesse Barnes Subject: Re: [PATCH 2/8] lib: Introduce drmtest_skip_on_simulation() Date: Thu, 18 Jul 2013 09:57:01 -0700 Message-ID: <20130718095701.5e3d6622@jbarnes-desktop> References: <1374160753-21781-1-git-send-email-damien.lespiau@intel.com> <1374160753-21781-3-git-send-email-damien.lespiau@intel.com> <20130718091834.547d863c@jbarnes-desktop> <20130718163115.GB6696@bwidawsk.net> <20130718165500.GK7379@strange.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy6-pub.bluehost.com (oproxy6-pub.bluehost.com [67.222.54.6]) by gabe.freedesktop.org (Postfix) with SMTP id 02E6FE5DEB for ; Thu, 18 Jul 2013 09:57:03 -0700 (PDT) In-Reply-To: <20130718165500.GK7379@strange.amr.corp.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: Ben Widawsky , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, 18 Jul 2013 17:55:00 +0100 Damien Lespiau wrote: > On Thu, Jul 18, 2013 at 09:31:15AM -0700, Ben Widawsky wrote: > > On Thu, Jul 18, 2013 at 09:18:34AM -0700, Jesse Barnes wrote: > > > On Thu, 18 Jul 2013 16:19:07 +0100 > > > Damien Lespiau wrote: > > > > > > > This will allow us to explicitely blacklist tests we don't want to run > > > > on simulation. > > > > I agree with Jesse on this. Mostly what I've wanted is an "opt-in" > > approach as opposed to an "opt-out" one. Such a thing is better > > controlled via a Makefile target, or separate script. > > Well, for this one I'd like a slightly different approach. Actually have > a drmtest structure with metadata about the test. Something like: > > #define DECLARE_SUBTEST(n, func, d) \ > { \ > .name = n, \ > .run = func, \ > .data = d, \ > } > > enum drmtest_category { > TEST_DISPLAY = (1 << 0), > TEST_GT = (1 << 1), > TEST_CONTEXT = (1 << 2), > TEST_GEM = (1 << 3), > TEST_TORTURE = (1 << 31), > }; > > > struct drm_subtest { > const char *name; > int (*run)(struct drm_test *test); > void *data; > }; > > struct drm_test { > const char *name; > int fd; > enum drmtest_category categories; > int subtests_nr; > struct drm_subtest *subtests; > }; > > and in the test: > > struct drm_subtest subtests[] = { > DECLARE_SUBTEST("bad-close", test_bad_close, &test_data), > DECLARE_SUBTEST("create-close", test_create_close, &test_data), > DECLARE_SUBTEST("create-fd-close", test_create_fd_close, &test_data), > }; > > struct drm_test test = { > .name = "gem-basic", > .subtests = subtests, > .subtests_nr = ARRAY_SIZE(subtests), > }; > > (better macros possible) > > and: > drmtest_init(&test, argc, argv); > drmtest_run(&test); > > That'll allow you to do things like "please run all the context tests" for > instance. > > But well, still quite far away, and it maybe quite hard/time consuming to > convert some tests to that. > Yeah that sounds like the ideal situation, so you can just run a set of subtests for the stuff you're working on... It'll only get harder to convert as we add more tests. :) -- Jesse Barnes, Intel Open Source Technology Center