summaryrefslogtreecommitdiffstats
path: root/test/run
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2004-01-28 01:36:39 +0000
committerAndreas Gruenbacher <agruen@suse.de>2004-01-28 01:36:39 +0000
commit78aa77c7415f569ad964d8b5b03ddb048f90beee (patch)
treea8e3645f5bf1b705d7db5b9df4045f9efa54464c /test/run
parent74367691ed6938fb64ee66df6c9db99d6b1870f9 (diff)
downloadquilt-78aa77c7415f569ad964d8b5b03ddb048f90beee.tar.gz
- Add a few more test cases for subdirectory support.
- Fix a few bugs introduced while merging Chris's patch.
Diffstat (limited to 'test/run')
-rwxr-xr-xtest/run12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/run b/test/run
index f60f9c6..026263a 100755
--- a/test/run
+++ b/test/run
@@ -13,11 +13,12 @@ use strict;
use FileHandle;
use Getopt::Std;
use POSIX qw(isatty setuid);
-use vars qw($opt_v);
+use vars qw($opt_l $opt_v);
no warnings qw(taint);
-getopts('v');
+$opt_l = ~0; # a really huge number
+getopts('l:v');
my ($OK, $FAILED) = ("ok", "failed");
if (isatty(fileno(STDOUT))) {
@@ -28,12 +29,12 @@ if (isatty(fileno(STDOUT))) {
sub exec_test($$);
my ($prog, $in, $out) = ([], [], []);
-my $line_number = 0;
my $prog_line;
my ($tests, $failed) = (0,0);
+my $lineno;
for (;;) {
- my $line = <>; $line_number++;
+ my $line = <>; $lineno++;
if (defined $line) {
# Substitute %VAR and %{VAR} with environment variables.
$line =~ s[%(?:(\w+)|\{(\w+)\})][$ENV{"$1$2"}]eg;
@@ -45,6 +46,7 @@ for (;;) {
push @$out, $line;
} else {
process_test($prog, $prog_line, $in, $out);
+ last if $prog_line >= $opt_l;
$prog = [];
$prog_line = 0;
@@ -52,7 +54,7 @@ for (;;) {
if ($line =~ s/^\s*\$ ?//) {
$line =~ s/\s+#.*//; # remove comments here...
$prog = [ map { s/\\(.)/$1/g; $_ } split /(?<!\\)\s+/, $line ];
- $prog_line = $line_number;
+ $prog_line = $lineno;
$in = [];
$out = [];
}