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 154CE1B257 for ; Thu, 21 Dec 2017 11:15:25 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2017 02:15:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,435,1508828400"; d="scan'208";a="4482982" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by orsmga007.jf.intel.com with ESMTP; 21 Dec 2017 02:15:24 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: harry.van.haaren@intel.com, Bruce Richardson Date: Thu, 21 Dec 2017 10:15:09 +0000 Message-Id: <20171221101510.181082-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171221101510.181082-1-bruce.richardson@intel.com> References: <20171221101510.181082-1-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH 1/2] test/test: fix missed failures when running meson test 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: Thu, 21 Dec 2017 10:15:26 -0000 When using meson test, and/or the DPDK_TEST environment variable for running specific tests, the return value from the test binary was the value returned from the unit test runner function. However, not all tests use that unit test runner infrastructure - some are regular functions, and so the failure of those tests would not be recognised. Fix this by setting the last_test_result value inside the command-line function that calls the individual test fns and that prints the "Test OK" or "Test Failure" messages. Fixes: d79a9657a78c ("meson: add tests app to build") Signed-off-by: Bruce Richardson --- test/test/commands.c | 1 + test/test/test.c | 2 +- test/test/test.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test/commands.c b/test/test/commands.c index 4097a3310..6649cfc32 100644 --- a/test/test/commands.c +++ b/test/test/commands.c @@ -103,6 +103,7 @@ static void cmd_autotest_parsed(void *parsed_result, ret = t->callback(); } + last_test_result = ret; if (ret == 0) printf("Test OK\n"); else diff --git a/test/test/test.c b/test/test/test.c index fb4d4753e..bc273db07 100644 --- a/test/test/test.c +++ b/test/test/test.c @@ -102,7 +102,7 @@ do_recursive_call(void) return -1; } -static int last_test_result; +int last_test_result; int main(int argc, char **argv) diff --git a/test/test/test.h b/test/test/test.h index 08ffe949c..2e9018437 100644 --- a/test/test/test.h +++ b/test/test/test.h @@ -218,6 +218,7 @@ struct unit_test_suite { }; int unit_test_suite_runner(struct unit_test_suite *suite); +extern int last_test_result; #define RECURSIVE_ENV_VAR "RTE_TEST_RECURSIVE" -- 2.14.3