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 dpdk.org (Postfix) with ESMTP id D459D1B1E6; Wed, 10 Jan 2018 15:24:21 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jan 2018 06:24:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,340,1511856000"; d="scan'208";a="193741225" Received: from dwdohert-mobl.ger.corp.intel.com (HELO [163.33.228.176]) ([163.33.228.176]) by fmsmga005.fm.intel.com with ESMTP; 10 Jan 2018 06:24:19 -0800 To: Anatoly Burakov , dev@dpdk.org Cc: stable@dpdk.org References: <432ebfd1f25d903f60b276790a3029c5480e3306.1513867661.git.anatoly.burakov@intel.com> From: "Doherty, Declan" Message-ID: <4facb05e-9cfa-3bf3-c05a-0323758bdb80@intel.com> Date: Wed, 10 Jan 2018 14:24:19 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <432ebfd1f25d903f60b276790a3029c5480e3306.1513867661.git.anatoly.burakov@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] test: register test as failed if setup failed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jan 2018 14:24:22 -0000 On 22/12/2017 10:21 AM, Anatoly Burakov wrote: > If test set up couldn't be completed, the test was previously > shown as succeeding, even though setup failed. Fix this to report > test as failed, and count all tests that should've been executed, > as failed as well. > > Fixes: ffac67b1f71b ("app/test: new assert macros and test suite runner") > Cc: declan.doherty@intel.com > Cc: stable@dpdk.org > Signed-off-by: Anatoly Burakov > --- > test/test/test.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/test/test/test.c b/test/test/test.c > index 0e6ff7c..fe41d40 100644 > --- a/test/test/test.c > +++ b/test/test/test.c > @@ -162,8 +162,20 @@ unit_test_suite_runner(struct unit_test_suite *suite) > } > > if (suite->setup) > - if (suite->setup() != 0) > + if (suite->setup() != 0) { > + /* > + * setup failed, so count all enabled tests and mark > + * them as failed > + */ > + while (suite->unit_test_cases[total].testcase) { > + if (!suite->unit_test_cases[total].enabled) > + skipped++; > + else > + failed++; > + total++; > + } > goto suite_summary; > + } > > printf(" + ------------------------------------------------------- +\n"); > > Acked-by: Declan Doherty