diff options
author | Richard Levitte <levitte@openssl.org> | 2015-04-29 21:51:25 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-09-07 16:10:58 +0200 |
commit | caadc54381af04dd49d9812737d40fea320c8674 (patch) | |
tree | 9dea613dcab397aa055cac2bca0826104895ddb2 /test/testlib | |
parent | fb921436f3dc03daf4a7ac1fec9f1e458772e17b (diff) |
New feature: STOPTEST
When the environment variable STOPTEST is defined (with any value other
than the empty string), the test machinery in OpenSSL::Test goes into a
different mode that will stop all testing at the end of a failing recipe.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/testlib')
-rw-r--r-- | test/testlib/OpenSSL/Test.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/testlib/OpenSSL/Test.pm b/test/testlib/OpenSSL/Test.pm index 644f4dd6a5..207e801607 100644 --- a/test/testlib/OpenSSL/Test.pm +++ b/test/testlib/OpenSSL/Test.pm @@ -27,6 +27,8 @@ my %directories = (); # Directories we want to keep track of # to the environment variables TOP (mandatory), # BIN_D, TEST_D and RESULT_D. +my $end_with_bailout = 0; + sub quotify; sub __top_file { @@ -140,6 +142,8 @@ sub setup { $directories{TEST} = $ENV{TEST_D} || catdir($directories{TOP},"test"); $directories{RESULTS} = $ENV{RESULT_D} || $directories{TEST}; + $end_with_bailout = $ENV{STOPTEST} ? 1 : 0; + BAIL_OUT("setup() expects the file Configure in the \$TOP directory") unless -f top_file("Configure"); @@ -273,6 +277,13 @@ sub cmdstr { return $display_cmd; } +END { + my $tb = Test::More->builder; + my $failure = scalar(grep { $_ == 0; } $tb->summary); + if ($failure && $end_with_bailout) { + BAIL_OUT("Stoptest!"); + } +} sub run { my ($cmd, $display_cmd, %errlogs) = shift->(0); my %opts = @_; |