[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Thu Sep 1 19:01:55 UTC 2016


The branch master has been updated
       via  b3e718e286c7a51fb1defc4136695937f4f19d66 (commit)
       via  967e831e88bc45ea32e5b3c762945859996771ff (commit)
       via  a5e1f1230e09b249ff94cc48aeffd1b874cb937e (commit)
       via  90aeaf6bceb38746f9fa9fea9f73e4f682f37fb6 (commit)
      from  7f9ae88817ddf0aac5c6bd95d9a5af1c54ed5bbf (commit)


- Log -----------------------------------------------------------------
commit b3e718e286c7a51fb1defc4136695937f4f19d66
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Sep 1 18:48:19 2016 +0200

    Document the enhanced tests specification
    
    Reviewed-by: Emilia Käsper <emilia at openssl.org>

commit 967e831e88bc45ea32e5b3c762945859996771ff
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Sep 1 13:44:05 2016 +0200

    Revert "INSTALL: add information on option no-fuzz-test"
    
    This reverts commit 7f9ae88817ddf0aac5c6bd95d9a5af1c54ed5bbf.
    
    Reviewed-by: Emilia Käsper <emilia at openssl.org>

commit a5e1f1230e09b249ff94cc48aeffd1b874cb937e
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Sep 1 13:43:40 2016 +0200

    Revert "Make it possible to disable fuzz testing"
    
    This reverts commit eb40eaed727500bf4a15f848c99e37edd18e142e.
    
    Reviewed-by: Emilia Käsper <emilia at openssl.org>

commit 90aeaf6bceb38746f9fa9fea9f73e4f682f37fb6
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Sep 1 13:34:32 2016 +0200

    Add a more versatile test chooser
    
    So far, the test runner (test/run_tests.pl) could get a list of tests
    to run, and if non were given, it assumes all available tests should
    be performed.
    
    However, that makes skipping just one or two tests a bit of a pain.
    This change makes the possibilities more versatile, run_checker.pl
    takes these arguments and will process them in the given order,
    starting with an empty set of tests to perform:
    
        alltests            The current set becomes the whole set of
                            available tests.
        test_xxx            Adds 'test_xxx' to the current set.
        -test_xxx           Removes 'test_xxx' from the current set.  If
                            nothing has been added to the set before this
                            argument, the current set is first initialised
                            to the whole set of available tests, then
                            'test_xxx' is removed from the current set.
        list                Display all available tests, then stop.
    
    If no arguments are given, 'alltests' is assumed.
    
    Reviewed-by: Emilia Käsper <emilia at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 Configure                   |  1 -
 INSTALL                     | 40 +++++++++++++++++++++----
 test/recipes/05-test_fuzz.t |  3 --
 test/run_tests.pl           | 71 ++++++++++++++++++++++++++++++---------------
 4 files changed, 83 insertions(+), 32 deletions(-)

diff --git a/Configure b/Configure
index 4fbce03..0a1b68a 100755
--- a/Configure
+++ b/Configure
@@ -342,7 +342,6 @@ my @disablables = (
     "filenames",
     "fuzz-libfuzzer",
     "fuzz-afl",
-    "fuzz-test",
     "gost",
     "heartbeats",
     "hw(-.+)?",
diff --git a/INSTALL b/INSTALL
index 6dcb4a0..c63797a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -320,11 +320,6 @@
                    platforms and should never be used in production environments.
                    See the file fuzz/README.md for further details.
 
-  no-fuzz-test
-                   Don't runt the fuzz test suite when testing. Use with
-                   caution, as those tests may be important.  However, that
-                   suite is particularly slow, and is therefore skippable.
-
   no-gost
                    Don't build support for GOST based ciphersuites. Note that
                    if this feature is enabled then GOST ciphersuites are only
@@ -672,6 +667,9 @@
 
      Please send bug reports to <rt at openssl.org>.
 
+     For more details on how the make variables TESTS can be used,
+     see section TESTS in Detail below.
+
   4. If everything tests ok, install OpenSSL with
 
        $ make install                                   # Unix
@@ -884,6 +882,38 @@
                 automatically generated files; add new error codes or add new
                 (or change the visibility of) public API functions. (Unix only).
 
+ TESTS in Detail
+ ---------------
+
+ The make variable TESTS supports a versatile set of space separated tokens
+ with which you can specify a set of tests to be performed.  With a "current
+ set of tests" in mind, initially being empty, here are the possible tokens:
+
+ alltests       The current set of tests becomes the whole set of available
+                tests (as listed when you do 'make list-tests' or similar).
+ xxx            Adds the test 'xxx' to the current set of tests.
+ -xxx           Removes 'xxx' from the current set of tests.  If this is the
+                first token in the list, the current set of tests is first
+                assigned the whole set of available tests, effectively making
+                this token equivalent to TESTS="alltests -xxx"
+
+ Also, all tokens except for "alltests" may have wildcards, such as *.
+ (on Unix and Windows, BSD style wildcards are supported, while on VMS,
+ it's VMS style wildcards)
+
+ Example: All tests except for the fuzz tests:
+
+ $ make TESTS=-test_fuzz test
+
+ or (if you want to be explicit)
+
+ $ make TESTS='alltests -test_fuzz' test
+
+ Example: All tests that have a name starting with "test_ssl" but not those
+ starting with "test_ssl_":
+
+ $ make TESTS='test_ssl* -test_ssl_*' test
+
  Note on multi-threading
  -----------------------
 
diff --git a/test/recipes/05-test_fuzz.t b/test/recipes/05-test_fuzz.t
index f1ccfe3..d152925 100755
--- a/test/recipes/05-test_fuzz.t
+++ b/test/recipes/05-test_fuzz.t
@@ -15,9 +15,6 @@ use OpenSSL::Test::Utils;
 
 setup("test_fuzz");
 
-plan skip_all => "Fuzz testing is disabled by this OpenSSL build"
-    if disabled("fuzz-test");
-
 my @fuzzers = ('asn1', 'asn1parse', 'bignum', 'bndiv', 'conf', 'crl', 'server', 'x509');
 if (!disabled("cms")) {
     push @fuzzers, 'cms';
diff --git a/test/run_tests.pl b/test/run_tests.pl
index 6550e0b..66697db 100644
--- a/test/run_tests.pl
+++ b/test/run_tests.pl
@@ -35,31 +35,56 @@ $utillib =~ s|\\|\\\\|g if $^O eq "MSWin32";
 # switches to be used when it calls our recipes.
 $switches = "-w \"-I$testlib\" \"-I$utillib\"";
 
-my @tests = ( "alltests" );
-if (@ARGV) {
-    @tests = @ARGV;
-}
-my $list_mode = scalar(grep /^list$/, @tests) != 0;
-if (grep /^(alltests|list)$/, @tests) {
-    @tests = grep {
-	basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
-    } glob(catfile($recipesdir,"*.t"));
-} else {
-    my @t = ();
-    foreach (@tests) {
-	push @t, grep {
-	    basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
-	} glob(catfile($recipesdir,"*-$_.t"));
+my @alltests = find_matching_tests("*");
+my %tests = ();
+
+my $initial_arg = 1;
+foreach my $arg (@ARGV ? @ARGV : ('alltests')) {
+    if ($arg eq 'list') {
+	foreach (@alltests) {
+	    (my $x = basename($_)) =~ s|^[0-9][0-9]-(.*)\.t$|$1|;
+	    print $x,"\n";
+	}
+	exit 0;
     }
-    @tests = @t;
+    if ($arg eq 'alltests') {
+	warn "'alltests' encountered, ignoring everything before that...\n"
+	    unless $initial_arg;
+	%tests = map { $_ => 1 } @alltests;
+    } elsif ($arg =~ m/^(-?)(.*)/) {
+	my $sign = $1;
+	my $test = $2;
+	my @matches = find_matching_tests($test);
+
+	# If '-foo' is the first arg, it's short for 'alltests -foo'
+	if ($sign eq '-' && $initial_arg) {
+	    %tests = map { $_ => 1 } @alltests;
+	}
+
+	if (scalar @matches == 0) {
+	    warn "Test $test found no match, skipping ",
+		($sign eq '-' ? "removal" : "addition"),
+		"...\n";
+	} else {
+	    foreach $test (@matches) {
+		if ($sign eq '-') {
+		    delete $tests{$test};
+		} else {
+		    $tests{$test} = 1;
+		}
+	    }
+	}
+    } else {
+	warn "I don't know what '$arg' is about, ignoring...\n";
+    }
+
+    $initial_arg = 0;
 }
 
-if ($list_mode) {
-    @tests = map { $_ = basename($_); $_ =~ s/^[0-9][0-9]-//; $_ =~ s/\.t$//;
-                   $_ } @tests;
-    print join("\n", @tests), "\n";
-} else {
-    @tests = map { abs2rel($_, rel2abs(curdir())); } @tests;
+runtests(map { abs2rel($_, rel2abs(curdir())); } sort keys %tests);
+
+sub find_matching_tests {
+    my ($glob) = @_;
 
-    runtests(sort @tests);
+    return glob(catfile($recipesdir,"*-$glob.t"));
 }


More information about the openssl-commits mailing list