]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tap: some preparatory refactoring (2)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 17 Jul 2011 14:04:06 +0000 (16:04 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 2 Aug 2011 21:01:25 +0000 (23:01 +0200)
This is a follow-up simplification.

* lib/tap-driver (console_output): Renamed ...
(report): ... to this, and extended to appropriately register
the test results when needed.
(testsuite_error, handle_tap_comment, handle_tap_test,
handle_tap_plan): Adjusted accordingly.

ChangeLog
lib/tap-driver

index 941d747174448ed0b8bbd462d3b735d3b216133d..6ee3fd5b9c1bfb340ee963aca41ce0a0427c9bc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-07-18  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tap: some preparatory refactoring (2)
+       This is a follow-up simplification.
+       * lib/tap-driver (console_output): Renamed ...
+       (report): ... to this, and extended to appropriately register
+       the test results when needed.
+       (testsuite_error, handle_tap_comment, handle_tap_test,
+       handle_tap_plan): Adjusted accordingly.
+
 2011-07-18  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        tap: some preparatory refactoring (1)
index eb505dea180590debb60351d7445c21969e7fb6a..b669292b9f21457c6ec711095cf04debb2193fbd 100755 (executable)
@@ -211,12 +211,13 @@ sub stringify_test_result ($)
   die "INTERNAL ERROR"; # NOTREACHED
 }
 
-sub console_output ($;$)
+sub report ($;$)
 {
   my ($msg, $result, $explanation) = (undef, @_);
   if ($result =~ /^(?:X?(?:PASS|FAIL)|SKIP|ERROR)/)
     {
       $msg = "$result: $test_script_name";
+      add_test_result $result;
     }
   elsif ($result eq "#")
     {
@@ -236,8 +237,7 @@ sub console_output ($;$)
 
 sub testuite_error ($)
 {
-  add_test_result "ERROR";
-  console_output "ERROR", "- $_[0]";
+  report "ERROR", "- $_[0]";
 }
 
 sub handle_tap_test ($)
@@ -268,8 +268,7 @@ sub handle_tap_test ($)
           $string .= " $explanation";
         }
     }
-  add_test_result $test_result;
-  console_output $test_result, $string;
+  report $test_result, $string;
 }
 
 sub handle_tap_plan ($)
@@ -288,8 +287,7 @@ sub handle_tap_plan ($)
     if not defined $plan->directive && length ($plan->directive) > 0;
   my $explanation = $plan->explanation ?
                     "- " . $plan->explanation : undef;
-  add_test_result "SKIP";
-  console_output "SKIP", $explanation;
+  report "SKIP", $explanation;
   finish;
 }
 
@@ -305,7 +303,7 @@ sub handle_tap_comment ($)
 {
   return unless $cfg{comments};
   my $comment = $_[0]->comment;
-  console_output "#", "$comment" if length $comment;
+  report "#", "$comment" if length $comment;
 }
 
 sub main (@)