develooper Front page | perl.perl5.porters | Postings from February 2015

bisect crash

Thread Next
From:
hv
Date:
February 11, 2015 18:34
Subject:
bisect crash
Message ID:
201502111832.t1BIWcP14862@crypt.org
I hacked up the change below to help on some test-cases that were tricky
to make exit 0 on success, does this seem useful enough to merge?

Hugo

diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl
index 5f78cf9..54994df 100755
--- a/Porting/bisect-runner.pl
+++ b/Porting/bisect-runner.pl
@@ -53,7 +53,7 @@ push @paths, qw(/usr/local/lib /lib /usr/lib)
         unless $linux64;
 
 unless(GetOptions(\%options,
-                  'target=s', 'make=s', 'jobs|j=i', 'expect-pass=i',
+                  'target=s', 'make=s', 'jobs|j=i', 'crash', 'expect-pass=i',
                   'expect-fail' => sub { $options{'expect-pass'} = 0; },
                   'clean!', 'one-liner|e=s@', 'c', 'l', 'w', 'match=s',
                   'no-match=s' => sub {
@@ -151,6 +151,8 @@ bisect.pl - use git bisect to pinpoint changes
     .../Porting/bisect.pl --expect-fail --match '\buseithreads\b'
     # When did this test program stop exiting 0?
     .../Porting/bisect.pl -- ./perl -Ilib ../test_prog.pl
+    # When did this test program start crashing?
+    .../Porting/bisect.pl --crash -- ./perl -Ilib ../test_prog.pl
     # When did this first become valid syntax?
     .../Porting/bisect.pl --target=miniperl --end=v5.10.0 \
          --expect-fail -e 'my $a := 2;'
@@ -397,6 +399,13 @@ revision. The bisect run will find the first commit where i
 
 =item *
 
+--crash
+
+Treat any non-crash as success, any crash as failure. (Crashing defined
+as exiting with a signal or a core dump.)
+
+=item *
+
 -D I<config_arg=value>
 
 =item *
@@ -1137,6 +1146,7 @@ sub run_report_and_exit {
     my $ret = run_with_options({setprgp => $options{setpgrp},
                                 timeout => $options{timeout},
                                }, @_);
+    $ret &= 0xff if $options{crash};
     report_and_exit(!$ret, 'zero exit from', 'non-zero exit from', "@_");
 }
 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About