From 254eec8bb4844cc9b4ac9974ad34d3c5679d9fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 26 Oct 2017 09:47:36 +0200 Subject: [PATCH] Document choice of script exit code --- tests/scripts/curves.pl | 1 + tests/scripts/depends-hashes.pl | 1 + tests/scripts/depends-pkalgs.pl | 1 + tests/scripts/key-exchanges.pl | 1 + tests/scripts/test-ref-configs.pl | 1 + 5 files changed, 5 insertions(+) diff --git a/tests/scripts/curves.pl b/tests/scripts/curves.pl index b7cfdf674..004181432 100755 --- a/tests/scripts/curves.pl +++ b/tests/scripts/curves.pl @@ -36,6 +36,7 @@ my @curves = split( /\s+/, `sed -n -e '$sed_cmd' $config_h` ); system( "cp $config_h $config_h.bak" ) and die; sub abort { system( "mv $config_h.bak $config_h" ) and warn "$config_h not restored\n"; + # use an exit code between 1 and 124 for git bisect (die returns 255) warn $_[0]; exit 1; } diff --git a/tests/scripts/depends-hashes.pl b/tests/scripts/depends-hashes.pl index 46628a72d..29dcfb00c 100755 --- a/tests/scripts/depends-hashes.pl +++ b/tests/scripts/depends-hashes.pl @@ -45,6 +45,7 @@ my @hashes = split( /\s+/, system( "cp $config_h $config_h.bak" ) and die; sub abort { system( "mv $config_h.bak $config_h" ) and warn "$config_h not restored\n"; + # use an exit code between 1 and 124 for git bisect (die returns 255) warn $_[0]; exit 1; } diff --git a/tests/scripts/depends-pkalgs.pl b/tests/scripts/depends-pkalgs.pl index 3ab161523..14c92b221 100755 --- a/tests/scripts/depends-pkalgs.pl +++ b/tests/scripts/depends-pkalgs.pl @@ -60,6 +60,7 @@ my %algs = ( system( "cp $config_h $config_h.bak" ) and die; sub abort { system( "mv $config_h.bak $config_h" ) and warn "$config_h not restored\n"; + # use an exit code between 1 and 124 for git bisect (die returns 255) warn $_[0]; exit 1; } diff --git a/tests/scripts/key-exchanges.pl b/tests/scripts/key-exchanges.pl index 5ce890046..d167c67c7 100755 --- a/tests/scripts/key-exchanges.pl +++ b/tests/scripts/key-exchanges.pl @@ -33,6 +33,7 @@ my @kexes = split( /\s+/, `sed -n -e '$sed_cmd' $config_h` ); system( "cp $config_h $config_h.bak" ) and die; sub abort { system( "mv $config_h.bak $config_h" ) and warn "$config_h not restored\n"; + # use an exit code between 1 and 124 for git bisect (die returns 255) warn $_[0]; exit 1; } diff --git a/tests/scripts/test-ref-configs.pl b/tests/scripts/test-ref-configs.pl index fe6d154f9..600fc751e 100755 --- a/tests/scripts/test-ref-configs.pl +++ b/tests/scripts/test-ref-configs.pl @@ -55,6 +55,7 @@ my $config_h = 'include/mbedtls/config.h'; system( "cp $config_h $config_h.bak" ) and die; sub abort { system( "mv $config_h.bak $config_h" ) and warn "$config_h not restored\n"; + # use an exit code between 1 and 124 for git bisect (die returns 255) warn $_[0]; exit 1; }