]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
cs-bisection-step: Break out report_conflict
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 6 May 2015 22:39:18 +0000 (23:39 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 6 May 2015 23:51:35 +0000 (00:51 +0100)
We are going to want to reuse this.

Also, explicitly return 0 (for false) from conflicted_warning when it
doesn't apply.

No resulting functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
cs-bisection-step

index c9c8bb6c60822e4cc5ea796c8e16124b083b7c59..14f3638a35b7087d5ce6cb2892c797d1e7af785b 100755 (executable)
@@ -714,24 +714,31 @@ sub do_choose_this ($) {
     $choose->{Target}= 1;
 }
 
-sub conflicted_warning ($$) {
-    my ($n, $what) = @_;
-    if ($n->{Conflicted}) {
-        my $show_rtuple= $n->{Rtuple};
-        foreach my $flight (@{ $n->{Flights} }) {
-            $show_rtuple .= "\n flight $flight->{Flight}".
-                " (blessed $flight->{Blessing}) result $flight->{Result}";
-        }
-        summary_report(<<END, <<END, 16);
+sub report_conflict ($$$) {
+    my ($n, $what, $desc) = @_;
+    # always returns 1 for the convenience of its callers
+    my $show_rtuple= $n->{Rtuple};
+    foreach my $flight (@{ $n->{Flights} }) {
+       $show_rtuple .= "\n flight $flight->{Flight}".
+           " (blessed $flight->{Blessing}) result $flight->{Result}";
+    }
+    summary_report(<<END, <<END, 16);
 Not reproducible - supposed $what
 END
 Could not reproduce problem, or could not reproduce basis pass.
-Inconsistent test results at this revision (supposed $what):
+$desc; at this revision (supposed $what):
 $show_rtuple
 END
-        $n->{Target}= 1;
-        return 1;
+    $n->{Target}= 1;
+    return 1;
+}
+
+sub conflicted_warning ($$) {
+    my ($n, $what) = @_;
+    if ($n->{Conflicted}) {
+       return report_conflict($n, $what, 'Inconsistent test results')
     }
+    return 0;
 }
 
 our $repro_lastflight;