]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/recipes/99-test_fuzz.t
Update copyright year
[thirdparty/openssl.git] / test / recipes / 99-test_fuzz.t
CommitLineData
90d28f05 1#!/usr/bin/env perl
33388b44 2# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
90d28f05 3#
909f1a2e 4# Licensed under the Apache License 2.0 (the "License"). You may not use
90d28f05
BL
5# this file except in compliance with the License. You can obtain a copy
6# in the file LICENSE in the source distribution or at
7# https://www.openssl.org/source/license.html
8
9use strict;
10use warnings;
11
8d2214c0 12use OpenSSL::Glob;
90d28f05 13use OpenSSL::Test qw/:DEFAULT srctop_file/;
df0aa777 14use OpenSSL::Test::Utils;
90d28f05
BL
15
16setup("test_fuzz");
17
4410f9d7 18my @fuzzers = ('asn1', 'asn1parse', 'bignum', 'bndiv', 'client', 'conf', 'crl', 'server', 'x509');
e599d0ae
DDO
19if (!disabled("cmp")) {
20 push @fuzzers, 'cmp';
21}
df0aa777
MC
22if (!disabled("cms")) {
23 push @fuzzers, 'cms';
24}
49dadc1c
MC
25if (!disabled("ct")) {
26 push @fuzzers, 'ct';
27}
90d28f05
BL
28plan tests => scalar @fuzzers;
29
30foreach my $f (@fuzzers) {
31 subtest "Fuzzing $f" => sub {
9d740909
RL
32 my @dirs = glob(srctop_file('fuzz', 'corpora', $f));
33 push @dirs, glob(srctop_file('fuzz', 'corpora', "$f-*"));
90d28f05 34
9d740909 35 plan skip_all => "No corpora for $f-test" unless @dirs;
90d28f05 36
9d740909 37 plan tests => scalar @dirs;
90d28f05 38
9d740909 39 foreach (@dirs) {
90d28f05
BL
40 ok(run(fuzz(["$f-test", $_])));
41 }
42 }
43}