DPDK patches and discussions
 help / color / mirror / Atom feed
From: John McNamara <john.mcnamara@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] app/test: return error code on failed tests
Date: Thu, 11 Jun 2015 15:48:56 +0100	[thread overview]
Message-ID: <1434034136-12162-1-git-send-email-john.mcnamara@intel.com> (raw)

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 <john.mcnamara@intel.com>
---
 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
-- 
1.8.1.4

             reply	other threads:[~2015-06-11 14:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 14:48 John McNamara [this message]
2015-06-15 13:24 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434034136-12162-1-git-send-email-john.mcnamara@intel.com \
    --to=john.mcnamara@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).