From 086cab2b43c1abb603f7da32df663852cad81262 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Sat, 15 Sep 2012 16:04:45 +0300 Subject: tests: fail test on nonsuccessful exit code --- tests/common.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/common.rb b/tests/common.rb index 2563b38..c99016b 100755 --- a/tests/common.rb +++ b/tests/common.rb @@ -109,7 +109,7 @@ def testenv(bindfs_args, options = {}, &block) begin cmd = "../#{EXECUTABLE_PATH} #{bindfs_args} -f src mnt" if options[:valgrind] - cmd = "valgrind #{options[:valgrind_opts]} #{cmd}" + cmd = "valgrind --error-exitcode=100 #{options[:valgrind_opts]} #{cmd}" end bindfs_pid = Process.fork do exec cmd @@ -145,6 +145,11 @@ def testenv(bindfs_args, options = {}, &block) fail("ERROR: failed to umount") testcase_ok = false end + + if !$?.success? + fail("exit status: #{$?}") + testcase_ok = false + end begin Dir.chdir '..' -- cgit v1.2.3