stas 01/10/18 18:32:02
Modified: perl-framework/Apache-Test/lib/Apache TestRun.pm
Log:
- die on invalid command line args (invalid test dir/name or unknown
option)
Revision Changes Path
1.62 +17 -0
httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm
Index: TestRun.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- TestRun.pm 2001/10/19 01:24:24 1.61
+++ TestRun.pm 2001/10/19 01:32:02 1.62
@@ -88,6 +88,7 @@
my(@tests);
my $argv = $self->{argv};
+ my @leftovers = ();
for (@$argv) {
my $arg = $_;
#need the t/ for stat-ing, but dont want to include it in test output
@@ -117,11 +118,25 @@
next;
}
}
+ push @leftovers, $_;
}
$self->{tests} = [EMAIL PROTECTED];
+ $self->{argv} = [EMAIL PROTECTED];
}
+sub die_on_invalid_args {
+ my($self) = @_;
+
+ # at this stage $self->{argv} should be empty
+ my @invalid_argv = @{ $self->{argv} };
+ if (@invalid_argv) {
+ error "unknown opts or test names: @invalid_argv";
+ exit;
+ }
+
+}
+
sub passenv {
my $passenv = Apache::TestConfig->passenv;
for (keys %$passenv) {
@@ -526,6 +541,8 @@
$self->default_run_opts;
$self->split_test_args;
+
+ $self->die_on_invalid_args;
$self->start;