Re: [PATCH i-g-t] i915/selftest: Allow filtering of individual subtests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Petri Latvala (2019-01-25 09:44:50)
> On Tue, Jan 22, 2019 at 06:35:21PM +0000, Chris Wilson wrote:
> > Take an environment variable, SELFTESTS=foo,bar, and pass that along to
> > the kernel (as i915.st_filter=foo,bar) to provide fine grained test
> > selection. This can be either as an exact match to select only that
> > test, or to exclude only test. For example,
> > 
> > SELFTESTS=igt_vma_create,igt_vma_pin1 i915_selftest --run mock_vma
> > SELFTESTS=!igt_vma_create i915_selftest --run mock_vma
> > 
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > ---
> >  tests/i915/selftest.c | 18 ++++++++++++------
> >  1 file changed, 12 insertions(+), 6 deletions(-)
> > 
> > diff --git a/tests/i915/selftest.c b/tests/i915/selftest.c
> > index 80e515c61..b8d7f0af1 100644
> > --- a/tests/i915/selftest.c
> > +++ b/tests/i915/selftest.c
> > @@ -28,10 +28,16 @@ IGT_TEST_DESCRIPTION("Basic unit tests for i915.ko");
> >  
> >  igt_main
> >  {
> > -     igt_kselftests("i915",
> > -                    "mock_selftests=-1 disable_display=1",
> > -                    NULL, "mock");
> > -     igt_kselftests("i915",
> > -                    "live_selftests=-1 disable_display=1",
> > -                    "live_selftests", "live");
> > +     const char *env = getenv("SELFTESTS");
> > +     char opts[1024];
> > +
> > +     igt_assert(snprintf(opts, sizeof(opts),
> > +                         "mock_selftests=-1 disable_display=1 st_filter=%s",
> > +                         env) < sizeof(opts));
> 
> 
> I don't particularly like passing NULL to %s, even though glibc makes
> it print "(null)".

	env = getenv() ?: "";

Fwiw, Tvrtko had provided a patch to pass kmod options on the command
line, that might be a preferred approach.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux