[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [patch 6/8] test/run: Declare global variables as such
From: |
Jean Delvare |
Subject: |
[Quilt-dev] [patch 6/8] test/run: Declare global variables as such |
Date: |
Sun, 02 Feb 2014 15:20:22 +0100 |
User-agent: |
quilt/0.61-1 |
Declare all global variables with qw() and stop passing them as
arguments to some functions.
---
test/run | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/test/run
+++ b/test/run
@@ -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;
- [Quilt-dev] [patch 0/8] test/run: Cleanups and optimizations, Jean Delvare, 2014/02/02
- [Quilt-dev] [patch 1/8] test/run: Delay command line splitting, Jean Delvare, 2014/02/02
- [Quilt-dev] [patch 2/8] test/run: Use perl module Text::ParseWords, Jean Delvare, 2014/02/02
- [Quilt-dev] [patch 3/8] test/run: Drop support for su and sg, Jean Delvare, 2014/02/02
- [Quilt-dev] [patch 5/8] test/run: Reorder functions, Jean Delvare, 2014/02/02
- [Quilt-dev] [patch 6/8] test/run: Declare global variables as such,
Jean Delvare <=
- [Quilt-dev] [patch 8/8] test/run: Minor performance optimizations, Jean Delvare, 2014/02/02
- [Quilt-dev] [patch 4/8] test/run: Massive reindentation, Jean Delvare, 2014/02/02
- [Quilt-dev] [patch 7/8] test/run: Fix the condition for using /bin/sh, Jean Delvare, 2014/02/02
- Re: [Quilt-dev] [patch 0/8] test/run: Cleanups and optimizations, Andreas Grünbacher, 2014/02/02
- Re: [Quilt-dev] [patch 0/8] test/run: Cleanups and optimizations, Raphael Hertzog, 2014/02/05