httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestConfig.pm TestRun.pm
Date Wed, 17 Oct 2001 01:30:40 GMT
dougm       01/10/16 18:30:40

  Modified:    perl-framework/Apache-Test README
               perl-framework/Apache-Test/lib/Apache TestConfig.pm
                        TestRun.pm
  Log:
  backing out the set of --? enforcing patches due to breaking of:
   is not proxying requests:
   t/TEST -proxy
  
   args meant for Apache::TestRequest are dropped on the floor:
    t/TEST -post /foo content one=1         (-content was not working either)
    t/TEST -get /foo username x password y  (nor -username or -password)
  
   runs all tests rather than just the specified one:
    t/TEST -httpd ~/foo/httpd t/foo/bar.t
  
  also was using @ARGV instead of @$argv that is passed into
  Apache::PerlRun->getopts (hmm, maybe this is what broke things, but i've
  already spent too much time fighting these problems, just need things to
  work right now)
  
  Revision  Changes    Path
  1.13      +9 -12     httpd-test/perl-framework/Apache-Test/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/README,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- README	2001/10/06 05:03:33	1.12
  +++ README	2001/10/17 01:30:40	1.13
  @@ -7,9 +7,6 @@
   
   see t/TEST as an example test harness
   
  -For an extensive documentation see
  -modperl-2.0/docs/src/devel/writing_tests/writing_tests.pod.
  -
   see t/*.t for example tests
   
   if the file t/conf/httpd.conf.in exists, it will be used instead of
  @@ -48,16 +45,16 @@
   % t/TEST -configure
   
   run as user nobody:
  -% t/TEST -User nobody
  +% t/TEST User nobody
   
   run on a different port:
  -% t/TEST -Port 8799
  +% t/TEST Port 8799
   
   configure an httpd other than the default (that apxs figures out)
  -% t/TEST -httpd ~/ap/httpd-2.0/httpd
  +% t/TEST httpd ~/ap/httpd-2.0/httpd
   
   switch to another apxs
  -% t/TEST -apxs ~/ap/httpd-2.0-prefork/bin/apxs
  +% t/TEST apxs ~/ap/httpd-2.0-prefork/bin/apxs
   
   turn on tracing
   % t/TEST -preamble "PerlTrace all"
  @@ -72,19 +69,19 @@
   % t/TEST -head
   
   GET url with authentication credentials
  -% t/TEST -get /server-info -username dougm -password foo
  +% t/TEST -get /server-info username dougm password foo
   
   POST url (read content from string)
  -% t/TEST -post /TestApache::post -content 'name=dougm&company=covalent'
  +% t/TEST -post /TestApache::post content 'name=dougm&company=covalent'
   
   POST url (read content from stdin)
  -% t/TEST -post /TestApache::post -content - < foo.txt
  +% t/TEST -post /TestApache::post content - < foo.txt
   
   POST url (generate a body of data 1024 bytes in length)
  -% t/TEST -post /TestApache::post -content x1024
  +% t/TEST -post /TestApache::post content x1024
   
   POST url (only print headers, e.g. useful to just check Content-length)
  -% t/TEST -post -head /TestApache::post -content x100000
  +% t/TEST -post -head /TestApache::post content x100000
   
   GET url (only print headers, e.g. useful to just check Content-length)
   % t/TEST -get -head /foo
  
  
  
  1.74      +2 -3      httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
  
  Index: TestConfig.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- TestConfig.pm	2001/10/16 20:30:57	1.73
  +++ TestConfig.pm	2001/10/17 01:30:40	1.74
  @@ -68,9 +68,8 @@
       }
   
       while (my($key, $val) = splice @filter, 0, 2) {
  -        if ($key =~ /^-?-?(.+)/ # optinal - or -- prefix
  -            && exists $wanted_args->{$1}) {
  -            $keep{$1} = $val;
  +        if ($wanted_args->{$key}) {
  +            $keep{$key} = $val;
           }
           else {
               push @pass, $key, $val;
  
  
  
  1.58      +17 -29    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.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- TestRun.pm	2001/10/16 22:51:27	1.57
  +++ TestRun.pm	2001/10/17 01:30:40	1.58
  @@ -75,12 +75,12 @@
   #so we dont slurp arguments that are not tests, example:
   # httpd $HOME/apache-2.0/bin/httpd
   
  -sub split_test_args {
  -    my($self) = @_;
  +sub split_args {
  +    my($self, $argv) = @_;
   
  -    my(@tests);
  +    my(@tests, @args);
   
  -    for (@ARGV) {
  +    for (@$argv) {
           my $arg = $_;
           #need the t/ for stat-ing, but dont want to include it in test output
           $arg =~ s:^t/::;
  @@ -109,9 +109,12 @@
                   next;
               }
           }
  +
  +        push @args, $_;
       }
   
       $self->{tests} = \@tests;
  +    $self->{args}  = \@args;
   }
   
   sub passenv {
  @@ -125,13 +128,12 @@
   sub getopts {
       my($self, $argv) = @_;
   
  -    my(%opts, %vopts, %conf_opts);
  +    $self->split_args($argv);
   
  -    # no_permute  : an opt. value cannot come before the option
  -    # pass_through: all unknown things are to be left in @ARGV
  -    Getopt::Long::Configure(qw(pass_through no_permute));
  +    #dont count test files/dirs as @ARGV arguments
  +    local *ARGV = $self->{args};
  +    my(%opts, %vopts, %conf_opts);
   
  -    # grab from @ARGV only the options that we expect
       GetOptions(\%opts, @flag_opts, @help_opts,
                  (map "$_:s", @debug_opts, @request_opts, @ostring_opts),
                  (map "$_=s", @string_opts),
  @@ -140,29 +142,17 @@
                  (map { ("$_=s", $vopts{$_} ||= {}) } @hash_opts));
   
       $opts{$_} = $vopts{$_} for keys %vopts;
  -
  -    # separate configuration options and test files/dirs
  -    my @argv = ();
  -    while (@ARGV) {
  -        my $val = shift @ARGV;
  -        # a known config option?
  -        if ($val =~ /^--?(.+)/ # must have a leading - or --
  -            && exists $Apache::TestConfig::Usage{lc $1}) {
  -            $conf_opts{lc $1} = shift @ARGV || '';
  -        }
  -        else {
  -            push @argv, $val;
  -        }
  -    }
  -    # @ARGV now includes only test files/dirs if any at all
  -    @ARGV = @argv;
   
  -    # force regeneration of httpd.conf if commandline args want to modify it
  +    #force regeneration of httpd.conf if commandline args want to modify it
       $self->{reconfigure} = $opts{configure} ||
         (grep { $opts{$_}->[0] } qw(preamble postamble)) ||
  -        (grep { $Apache::TestConfig::Usage{$_} } keys %conf_opts ) ||
  +        (grep { $Apache::TestConfig::Usage{$_} } @ARGV) ||
             $self->passenv() || (! -e 'conf/httpd.conf');
   
  +    while (my($key, $val) = splice @ARGV, 0, 2) {
  +       $conf_opts{lc $key} = $val;
  +    }
  +
       if (exists $opts{debug}) {
           $opts{debugger} = $opts{debug};
           $opts{debug} = 1;
  @@ -496,8 +486,6 @@
       $self->try_exit_opts;
   
       $self->default_run_opts;
  -
  -    $self->split_test_args;
   
       $self->start;
   
  
  
  

Mime
View raw message