Re: [igt-dev] [PATCH i-g-t] lib: Update selftests to use dynamic subtests

Petri Latvala
2020-02-17T12:38:35Z

On Mon, Feb 17, 2020 at 11:32:17AM +0000, Chris Wilson wrote:
> Quoting Petri Latvala (2020-02-17 11:26:59)
> > On Mon, Feb 17, 2020 at 11:22:46AM +0000, Chris Wilson wrote:
> > > Quoting Petri Latvala (2020-02-17 11:17:28)
> > > > Oh, and in the same patch you can do this:
> > > >
> > > > Find the ugliest line you can find in tests/igt_command_line.sh and
> > > > change it to a prettier one.
> > >
> > > We can just delete it, right? Since with igt_subtest_with_dynamic() we
> > > always define the test group and so --list always reports something.
> > > Right?
> >
> > The if (and the fi), yes.
>
> --- a/tests/igt_command_line.sh
> +++ b/tests/igt_command_line.sh
> @@ -92,10 +92,8 @@ check_test ()
> # Subtest enumeration of kernel selftest launchers depends
> # on the running kernel. If selftests are not enabled,
> # they will output nothing and exit with 0.
> - if [ "$testname" != "i915_selftest" -a "$testname" != "drm_mm" -a "$testname" != "kms_selftest" -a "$testname" != "dmabuf" ]; then
> - echo " test does seem to be using igt_main() (should have subtests) and yet --list-subtests is empty!"
> - fail $test
> - fi
> + echo " test does seem to be using igt_main() (should have subtests) and yet --list-subtests is empty!"
> + fail $test
> fi

With all the rejoicing of being able to remove an ugly workaround, I
forgot that the above comment needs to go as well.

Five lines removed still counts as a one-liner, right?

--
Petri Latvala