DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/test: return error code on failed tests
@ 2015-06-11 14:48 John McNamara
  2015-06-15 13:24 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: John McNamara @ 2015-06-11 14:48 UTC (permalink / raw)
  To: 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 <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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] app/test: return error code on failed tests
  2015-06-11 14:48 [dpdk-dev] [PATCH] app/test: return error code on failed tests John McNamara
@ 2015-06-15 13:24 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-06-15 13:24 UTC (permalink / raw)
  To: John McNamara; +Cc: dev

2015-06-11 15:48, John McNamara:
> 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>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-15 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-11 14:48 [dpdk-dev] [PATCH] app/test: return error code on failed tests John McNamara
2015-06-15 13:24 ` Thomas Monjalon

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).