diff options
author | Ben Laurie <ben@links.org> | 2016-06-04 16:10:49 +0100 |
---|---|---|
committer | Ben Laurie <ben@links.org> | 2016-07-01 13:45:45 +0100 |
commit | 90d28f0519427ffc293f880c423d9c4395a6fcd4 (patch) | |
tree | bb3be2701c6ea2bbe31b6770c1c104fe8c5e4d5c /test/testlib/OpenSSL/Test.pm | |
parent | 2c12f22c3364a1e562a19415f9929359945a7c21 (diff) |
Run the fuzzing corpora as tests.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/testlib/OpenSSL/Test.pm')
-rw-r--r-- | test/testlib/OpenSSL/Test.pm | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/testlib/OpenSSL/Test.pm b/test/testlib/OpenSSL/Test.pm index 31f41057f0..0c3b9104e9 100644 --- a/test/testlib/OpenSSL/Test.pm +++ b/test/testlib/OpenSSL/Test.pm @@ -16,7 +16,8 @@ use Exporter; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = "0.8"; @ISA = qw(Exporter); -@EXPORT = (@Test::More::EXPORT, qw(setup indir app perlapp test perltest run)); +@EXPORT = (@Test::More::EXPORT, qw(setup indir app fuzz perlapp test perltest + run)); @EXPORT_OK = (@Test::More::EXPORT_OK, qw(bldtop_dir bldtop_file srctop_dir srctop_file pipe with cmdstr quotify)); @@ -285,6 +286,13 @@ sub app { return __build_cmd($num, \&__apps_file, $cmd, %opts); } } +sub fuzz { + my $cmd = shift; + my %opts = @_; + return sub { my $num = shift; + return __build_cmd($num, \&__fuzz_file, $cmd, %opts); } +} + sub test { my $cmd = shift; my %opts = @_; @@ -701,6 +709,8 @@ sub __env { $directories{BLDTOP} = $ENV{BLDTOP} || $ENV{TOP}; $directories{BLDAPPS} = $ENV{BIN_D} || __bldtop_dir("apps"); $directories{SRCAPPS} = __srctop_dir("apps"); + $directories{BLDFUZZ} = __bldtop_dir("fuzz"); + $directories{SRCFUZZ} = __srctop_dir("fuzz"); $directories{BLDTEST} = $ENV{TEST_D} || __bldtop_dir("test"); $directories{SRCTEST} = __srctop_dir("test"); $directories{RESULTS} = $ENV{RESULT_D} || $directories{BLDTEST}; @@ -778,6 +788,15 @@ sub __apps_file { return $f; } +sub __fuzz_file { + BAIL_OUT("Must run setup() first") if (! $test_name); + + my $f = pop; + $f = catfile($directories{BLDFUZZ},@_,$f . __exeext()); + $f = catfile($directories{SRCFUZZ},@_,$f) unless -x $f; + return $f; +} + sub __perlapps_file { BAIL_OUT("Must run setup() first") if (! $test_name); |