From patchwork Thu Jun 11 14:48:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John McNamara X-Patchwork-Id: 5385 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id D7E0D6849; Thu, 11 Jun 2015 16:49:01 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7F0675AA0 for ; Thu, 11 Jun 2015 16:49:00 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 11 Jun 2015 07:48:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,595,1427785200"; d="scan'208";a="741519368" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 11 Jun 2015 07:48:57 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t5BEmuv4003457; Thu, 11 Jun 2015 15:48:56 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t5BEmuuq012197; Thu, 11 Jun 2015 15:48:56 +0100 Received: (from jmcnam2x@localhost) by sivswdev02.ir.intel.com with id t5BEmuPg012193; Thu, 11 Jun 2015 15:48:56 +0100 From: John McNamara To: dev@dpdk.org Date: Thu, 11 Jun 2015 15:48:56 +0100 Message-Id: <1434034136-12162-1-git-send-email-john.mcnamara@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] app/test: return error code on failed tests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This change returns a system error code if tests fail when running any of the "make test" targets. This allows the tests to report failures while running in continuous integration environments. Previously "make test" returned $? == 0 for all combinations of success, failure and exception conditions. Signed-off-by: John McNamara --- app/test/autotest.py | 3 ++- app/test/autotest_runner.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/test/autotest.py b/app/test/autotest.py index a79db10..b9fd6b6 100644 --- a/app/test/autotest.py +++ b/app/test/autotest.py @@ -72,5 +72,6 @@ for test_group in autotest_data.parallel_test_group_list: for test_group in autotest_data.non_parallel_test_group_list: runner.add_non_parallel_test_group(test_group) -runner.run_all_tests() +num_fails = runner.run_all_tests() +sys.exit(num_fails) diff --git a/app/test/autotest_runner.py b/app/test/autotest_runner.py index 260b72c..586b0fa 100644 --- a/app/test/autotest_runner.py +++ b/app/test/autotest_runner.py @@ -400,6 +400,7 @@ class AutotestRunner: except: print "Exception occured" print sys.exc_info() + self.fails = 1 # drop logs from all executions to a logfile for buf in self.log_buffers: @@ -407,3 +408,4 @@ class AutotestRunner: log_buffers = [] + return self.fails