From d6235df66f573e3e6916d3149e48c868c42897a0 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel Vuotto Date: Thu, 6 Jun 2024 17:12:41 +0000 Subject: [PATCH] wycheproof: add a failfast mode --- wycheproof/aead.pl | 6 ++++-- wycheproof/mac.pl | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wycheproof/aead.pl b/wycheproof/aead.pl index 12a029c..b7c8cb0 100644 --- a/wycheproof/aead.pl +++ b/wycheproof/aead.pl @@ -12,7 +12,8 @@ sub slurp ($fh) { local $/; <$fh> } 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; } @@ -21,7 +22,7 @@ sub main () my %opts; my $rc = 0; - getopts("vx:", \%opts) && @ARGV > 0 or usage; + getopts("Fvx:", \%opts) && @ARGV > 0 or usage; usage unless defined $opts{"x"}; for my $f (@ARGV) { @@ -56,6 +57,7 @@ sub main () "$test->{comment} [", join(",", $test->{flags}->@*), "]"; + exit 1 if $opts{"F"}; } } } diff --git a/wycheproof/mac.pl b/wycheproof/mac.pl index d53b43e..73875d8 100644 --- a/wycheproof/mac.pl +++ b/wycheproof/mac.pl @@ -12,7 +12,8 @@ sub slurp ($fh) { local $/; <$fh> } 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; } @@ -21,7 +22,7 @@ sub main () my %opts; my $rc = 0; - getopts("vx:", \%opts) && @ARGV > 0 or usage; + getopts("Fvx:", \%opts) && @ARGV > 0 or usage; usage unless defined $opts{"x"}; for my $f (@ARGV) { @@ -52,6 +53,7 @@ sub main () "$test->{comment} [", join(",", $test->{flags}->@*), "]"; + exit 1 if $opts{"F"}; } } }