From 42851b794a9bed9fdbb7240b551ebd6bd55f77e7 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sun, 7 Aug 2011 21:34:56 +0200 Subject: [PATCH] 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. --- ChangeLog | 10 ++++++++++ lib/tap-driver | 30 ++---------------------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 328ca844d..86e565b49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-08-07 Stefano Lattarini + + 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 testsuite: fix spurious failure in a test on TAP support diff --git a/lib/tap-driver b/lib/tap-driver index 948c3d5b9..239334630 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"; -- 2.47.2