summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quilt.changes1
-rwxr-xr-xtest/run12
2 files changed, 7 insertions, 6 deletions
diff --git a/quilt.changes b/quilt.changes
index 30cee3c..a83f2c0 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -6,6 +6,7 @@ Wed Feb 12 20:57:35 CET 2014 - jdelvare@suse.de
- test/run: Drop support for su and sg.
- test/run: Massive reindentation.
- test/run: Reorder functions.
+- test/run: Declare global variables as such.
-------------------------------------------------------------------
Mon Feb 10 13:07:14 CET 2014 - jdelvare@suse.de
diff --git a/test/run b/test/run
index 1471bce..3e84b0c 100755
--- 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;