wycheproof: add a failfast mode

This commit is contained in:
Lucas Gabriel Vuotto 2024-06-06 17:12:41 +00:00
parent 52ab9ca179
commit d6235df66f
2 changed files with 8 additions and 4 deletions

View File

@ -12,7 +12,8 @@ sub slurp ($fh) { local $/; <$fh> }
sub usage () sub usage ()
{ {
say STDERR "Usage: $progname -x runner json_file [json_files ...]"; say STDERR "Usage: $progname [-Fv] -x runner json_file ",
"[json_files ...]";
exit 1; exit 1;
} }
@ -21,7 +22,7 @@ sub main ()
my %opts; my %opts;
my $rc = 0; my $rc = 0;
getopts("vx:", \%opts) && @ARGV > 0 or usage; getopts("Fvx:", \%opts) && @ARGV > 0 or usage;
usage unless defined $opts{"x"}; usage unless defined $opts{"x"};
for my $f (@ARGV) { for my $f (@ARGV) {
@ -56,6 +57,7 @@ sub main ()
"$test->{comment} [", "$test->{comment} [",
join(",", $test->{flags}->@*), join(",", $test->{flags}->@*),
"]"; "]";
exit 1 if $opts{"F"};
} }
} }
} }

View File

@ -12,7 +12,8 @@ sub slurp ($fh) { local $/; <$fh> }
sub usage () sub usage ()
{ {
say STDERR "Usage: $progname -x runner json_file [json_files ...]"; say STDERR "Usage: $progname [-Fv] -x runner json_file ",
"[json_files ...]";
exit 1; exit 1;
} }
@ -21,7 +22,7 @@ sub main ()
my %opts; my %opts;
my $rc = 0; my $rc = 0;
getopts("vx:", \%opts) && @ARGV > 0 or usage; getopts("Fvx:", \%opts) && @ARGV > 0 or usage;
usage unless defined $opts{"x"}; usage unless defined $opts{"x"};
for my $f (@ARGV) { for my $f (@ARGV) {
@ -52,6 +53,7 @@ sub main ()
"$test->{comment} [", "$test->{comment} [",
join(",", $test->{flags}->@*), join(",", $test->{flags}->@*),
"]"; "]";
exit 1 if $opts{"F"};
} }
} }
} }