From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3473510E2C1 for ; Wed, 15 Dec 2021 14:31:46 +0000 (UTC) Date: Wed, 15 Dec 2021 06:31:46 -0800 Message-ID: <878rwm0wj1.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20211215103506.17273-1-petri.latvala@intel.com> References: <20211215103506.17273-1-petri.latvala@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [igt-dev] [PATCH i-g-t] lib/igt_core: Ensure subtest result is skip if all dynamic subtests skip List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Petri Latvala Cc: igt-dev@lists.freedesktop.org, Jari Tahvanainen List-ID: On Wed, 15 Dec 2021 02:35:06 -0800, Petri Latvala wrote: > > Even though the best practices for dynamic subtests is to not execute > the dynamic subtest at all instead of skipping, there are a couple of > tests that to the opposite, without an easy way to construct them > along best practices. Accomodate this with fixing the handling of > skipping dynamic subtests so that the result of the containing subtest > becomes a skip also if all dynamic subtests skip, not just when there > are no dynamic subtests. I have seen this happen and the patch should convert a success exit status to a skip exit status so this is: Reviewed-by: Ashutosh Dixit > > Signed-off-by: Petri Latvala > Cc: Arkadiusz Hiler > Cc: Jari Tahvanainen > --- > lib/igt_core.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/lib/igt_core.c b/lib/igt_core.c > index ec05535c..7c906675 100644 > --- a/lib/igt_core.c > +++ b/lib/igt_core.c > @@ -1471,7 +1471,14 @@ void igt_skip(const char *f, ...) > } > > if (in_subtest) { > - /* Doing the same even if inside a dynamic subtest */ > + if (in_dynamic_subtest) { > + /* > + * Don't count skipping dynamic subtests, for > + * the purposes of getting the result of the > + * containing subtest. > + */ > + _igt_dynamic_tests_executed--; > + } > exit_subtest("SKIP"); > } else if (test_with_subtests) { > skip_subtests_henceforth = SKIP; > -- > 2.29.2 >