diff options
author | Jean Delvare <jdelvare@suse.de> | 2014-02-12 21:03:03 +0100 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2014-02-12 21:03:03 +0100 |
commit | 93830e666d6c1f71668ac80245e5c1d8785a6a88 (patch) | |
tree | d7fefd3332b1aa501e2a78456d4d81c8455dfd3c /test/run | |
parent | 7a801451ba460b5a09a7b230bec8488ebca082ab (diff) | |
download | quilt-93830e666d6c1f71668ac80245e5c1d8785a6a88.tar.gz |
test/run: Declare global variables as such
Declare all global variables with qw() and stop passing them as
arguments to some functions.
Diffstat (limited to 'test/run')
-rwxr-xr-x | test/run | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -49,22 +49,23 @@ use FileHandle; use Getopt::Std; use POSIX qw(isatty setuid getcwd); use Text::ParseWords; -use vars qw($opt_l $opt_q $opt_v %output); +use vars qw($opt_l $opt_q $opt_v %output $OK $FAILED $tests $failed); $opt_l = ~0; # a really huge number getopts('l:qv'); -my ($OK, $FAILED) = ("ok", "failed"); +$OK = "ok"; +$FAILED = "failed"; if (isatty(fileno(STDOUT))) { $OK = "\033[32m" . $OK . "\033[m"; $FAILED = "\033[31m\033[1m" . $FAILED . "\033[m"; } +$tests = $failed = 0; my $prog; my ($in, $out) = ([], []); my $prog_line = 0; my $last_status = 0; -my ($tests, $failed) = (0,0); my $lineno; my $width = ($ENV{COLUMNS} || 80) >> 1; my $origdir = getcwd; @@ -97,9 +98,8 @@ sub print_footer($) } } -sub flush_output($) +sub flush_output() { - my $failed = shift; return unless $opt_q; print $output{header} || "", @@ -315,5 +315,5 @@ if (isatty(fileno(STDOUT))) { } } print_footer "$status\n"; -flush_output $failed; +flush_output; exit $failed ? 1 : 0; |