From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5AC86EAB1 for ; Wed, 12 Feb 2020 13:42:07 +0000 (UTC) Date: Wed, 12 Feb 2020 15:42:04 +0200 From: Petri Latvala Message-ID: <20200212134204.GQ25209@platvala-desk.ger.corp.intel.com> References: <20200212132123.108506-1-arkadiusz.hiler@intel.com> <20200212132123.108506-5-arkadiusz.hiler@intel.com> <20200212133737.GP25209@platvala-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200212133737.GP25209@platvala-desk.ger.corp.intel.com> Subject: Re: [igt-dev] [PATCH i-g-t 4/9] runner/runner_tests: Extract helper for inspecting test result List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Arkadiusz Hiler Cc: igt-dev@lists.freedesktop.org List-ID: On Wed, Feb 12, 2020 at 03:37:37PM +0200, Petri Latvala wrote: > On Wed, Feb 12, 2020 at 03:21:18PM +0200, Arkadiusz Hiler wrote: > > to make this bit of code more readable and to reuse it in the following patch > > > > Signed-off-by: Arkadiusz Hiler > > --- > > runner/runner_tests.c | 30 +++++++++++++++++------------- > > 1 file changed, 17 insertions(+), 13 deletions(-) > > > > diff --git a/runner/runner_tests.c b/runner/runner_tests.c > > index ed30b3f9..dd590f33 100644 > > --- a/runner/runner_tests.c > > +++ b/runner/runner_tests.c > > @@ -32,6 +32,16 @@ static const char testdatadir[] = TESTDATA_DIRECTORY; > > /* The total number of test binaries in runner/testdata/ */ > > #define NUM_TESTDATA_BINARIES 4 > > > > +static const char *igt_get_result(struct json_object *tests, const char* testname) > > +{ > > + struct json_object *obj; > > + > > + igt_assert(json_object_object_get_ex(tests, testname, &obj)); > > + igt_assert(json_object_object_get_ex(obj, "result", &obj)); > > + > > + return json_object_get_string(obj); > > +} > > + > > static void igt_assert_eqstr(const char *one, const char *two) > > { > > if (one == NULL && two == NULL) > > @@ -1432,7 +1442,7 @@ igt_main > > > > igt_subtest("dynamic-subtests-in-testlist") { > > struct execute_state state; > > - struct json_object *results, *obj; > > + struct json_object *results, *tests; > > const char *argv[] = { "runner", > > "--test-list", filename, > > testdatadir, > > @@ -1453,16 +1463,13 @@ igt_main > > igt_assert_f((results = generate_results_json(dirfd)) != NULL, > > "Results parsing failed\n"); > > > > - obj = results; > > - igt_assert(json_object_object_get_ex(obj, "tests", &obj)); > > + igt_assert(json_object_object_get_ex(results, "tests", &tests)); > > > > /* Check that the dynamic subtest we didn't request is not reported */ > > - igt_assert(!json_object_object_get_ex(obj, "igt@dynamic@dynamic-subtest@failing", NULL)); > > + igt_assert_no_result_for(tests, "igt@dynamic@dynamic-subtest@failing"); > > > Where is igt_assert_no_result_for defined? *blind* Found it hiding in the next patch. -- Petri Latvala _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev