From patchwork Thu Jan 11 17:50:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 33630 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0522C1B2D2; Thu, 11 Jan 2018 18:50:57 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id DE11B1B2D2 for ; Thu, 11 Jan 2018 18:50:55 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2018 09:50:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,345,1511856000"; d="scan'208";a="18487119" Received: from silpixa00398672.ir.intel.com ([10.237.223.128]) by FMSMGA003.fm.intel.com with ESMTP; 11 Jan 2018 09:50:53 -0800 From: Harry van Haaren To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, bruce.richardson@intel.com, Harry van Haaren Date: Thu, 11 Jan 2018 17:50:34 +0000 Message-Id: <1515693035-35419-2-git-send-email-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515693035-35419-1-git-send-email-harry.van.haaren@intel.com> References: <1513858050-77961-1-git-send-email-harry.van.haaren@intel.com> <1515693035-35419-1-git-send-email-harry.van.haaren@intel.com> Subject: [dpdk-dev] [PATCH v2 2/3] test: add skipped return result 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit allows a test to return "skipped", indicating that it cannot be run. This is useful for PMDs which have not been compiled due to the unavailability of dependencies, or their explicit disabling in the build configuration. The result printing is updated to correctly indicate if a test has been skipped. Signed-off-by: Bruce Richardson Signed-off-by: Harry van Haaren Acked-by: Pablo de Lara --- v2: - Re-split patch into two, rewording titles check-git-log (Pablo) - Add check for "Skipped" tests to not print "Failed" (Pablo) --- test/test/commands.c | 2 ++ test/test/test.h | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test/commands.c b/test/test/commands.c index 6649cfc..0473dac 100644 --- a/test/test/commands.c +++ b/test/test/commands.c @@ -106,6 +106,8 @@ static void cmd_autotest_parsed(void *parsed_result, last_test_result = ret; if (ret == 0) printf("Test OK\n"); + else if (ret == TEST_SKIPPED) + printf("Test Skipped\n"); else printf("Test Failed\n"); fflush(stdout); diff --git a/test/test/test.h b/test/test/test.h index ae88a70..a8f765a 100644 --- a/test/test/test.h +++ b/test/test/test.h @@ -11,8 +11,9 @@ #include #include -#define TEST_SUCCESS (0) -#define TEST_FAILED (-1) +#define TEST_SUCCESS EXIT_SUCCESS +#define TEST_FAILED -1 +#define TEST_SKIPPED 77 /* Before including test.h file you can define * TEST_TRACE_FAILURE(_file, _line, _func) macro to better trace/debug test