summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-03-28 15:46:28 +0200
committerRichard Levitte <levitte@openssl.org>2018-03-29 10:57:51 +0200
commit0bdcf53fec5245bfc9ce27e438f4f5150f2c1d08 (patch)
tree475f191c370cbfc52b45a0f457a2031538455ca8 /test
parent7ee2a43069913fb7c444c656048996ea92cc465e (diff)
Faster fuzz test: teach the fuzz test programs to handle directories
Instead of invoking the fuzz test programs once for every corpora file, we invoke them once for each directory of corpora files. This dramatically reduces the number of program invokations, as well as the time 90-test_fuzz.t takes to complete. fuzz/test-corpus.c was enhanced to handle directories as well as regular files. Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/5788)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/90-test_fuzz.t10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/recipes/90-test_fuzz.t b/test/recipes/90-test_fuzz.t
index d152925733..753a1f2123 100644
--- a/test/recipes/90-test_fuzz.t
+++ b/test/recipes/90-test_fuzz.t
@@ -26,14 +26,14 @@ plan tests => scalar @fuzzers;
foreach my $f (@fuzzers) {
subtest "Fuzzing $f" => sub {
- my @files = glob(srctop_file('fuzz', 'corpora', $f, '*'));
- push @files, glob(srctop_file('fuzz', 'corpora', "$f-*", '*'));
+ my @dirs = glob(srctop_file('fuzz', 'corpora', $f));
+ push @dirs, glob(srctop_file('fuzz', 'corpora', "$f-*"));
- plan skip_all => "No corpora for $f-test" unless @files;
+ plan skip_all => "No corpora for $f-test" unless @dirs;
- plan tests => scalar @files;
+ plan tests => scalar @dirs;
- foreach (@files) {
+ foreach (@dirs) {
ok(run(fuzz(["$f-test", $_])));
}
}