automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {test-protocols} tap driver: refactor and remove dead code


From: Stefano Lattarini
Subject: [FYI] {test-protocols} tap driver: refactor and remove dead code
Date: Sun, 7 Aug 2011 22:52:23 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

* lib/tap-driver (get_tap_line): Removed, ...
(all callers): ... updated to use $parser->next directly instead.
(peek_tap_line, unget_tap_line, @tap_lines): Remove, they're not
used anymore.
(TAP_PEEKING): Block deleted, all its subroutines and variables
having been removed.
---
 ChangeLog      |   10 ++++++++++
 lib/tap-driver |   30 ++----------------------------
 2 files changed, 12 insertions(+), 28 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 328ca84..86e565b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-08-07  Stefano Lattarini  <address@hidden>
 
+       tap driver: refactor and remove dead code
+       * lib/tap-driver (get_tap_line): Removed, ...
+       (all callers): ... updated to use $parser->next directly instead.
+       (peek_tap_line, unget_tap_line, @tap_lines): Remove, they're not
+       used anymore.
+       (TAP_PEEKING): Block deleted, all its subroutines and variables
+       having been removed.
+
+2011-08-07  Stefano Lattarini  <address@hidden>
+
        testsuite: fix spurious failure in a test on TAP support
        * tests/tap-passthrough-exit.test: When the `--ignore-exit' flag
        of the TAP driver is used, don't look for a message reporting the
diff --git a/lib/tap-driver b/lib/tap-driver
index 948c3d5..2393346 100755
--- a/lib/tap-driver
+++ b/lib/tap-driver
@@ -98,7 +98,6 @@ sub decorate_result ($);
 sub extract_tap_comment ($);
 sub finish ();
 sub get_global_test_result ();
-sub get_tap_line ();
 sub get_test_exit_message ();
 sub get_test_results ();
 sub handle_tap_bailout ($);
@@ -106,12 +105,10 @@ sub handle_tap_plan ($);
 sub handle_tap_test ($);
 sub main (@);
 sub must_recheck ();
-sub peek_tap_line ();
 sub report ($;$);
 sub start (@);
 sub stringify_test_result ($);
 sub testsuite_error ($);
-sub unget_tap_line ($);
 sub write_test_results ();
 sub yn ($);
 
@@ -143,29 +140,6 @@ sub yn ($)
   return $bool ? "yes" : "no";
 }
 
-TAP_PEEKING :
-{
-  my @tap_lines = ();
-
-  sub get_tap_line ()
-  {
-    @tap_lines > 0 ? pop @tap_lines : $parser->next;
-  }
-
-  sub unget_tap_line ($)
-  {
-    push @tap_lines, @_;
-  }
-
-  sub peek_tap_line ()
-  {
-    my $res = get_tap_line;
-    unget_tap_line ($res);
-    return $res;
-  }
-
-}
-
 TEST_RESULTS :
 {
   my (@test_results, %test_results);
@@ -238,7 +212,7 @@ sub get_test_exit_message ()
 {
   # Flush all the remaining TAP stream, so that we can obtain the
   # exit status of the TAP producer.
-  do {} while defined get_tap_line ();
+  do {} while defined $parser->next;
   my $wstatus = $parser->wait;
   # Return an undefined value if the producer exited with success.
   return unless $wstatus;
@@ -432,7 +406,7 @@ sub main (@)
 {
   start @_;
 
-  while (defined (my $cur = get_tap_line))
+  while (defined (my $cur = $parser->next))
     {
       # Verbatim copy any input line into the log file.
       print $cur->raw . "\n";
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]