Re: Winnow?

2001-10-20 Thread Doug MacEachern
On Sat, 20 Oct 2001, William A. Rowe, Jr. wrote:

> Could be cool if -winnow or some other arg would run only failed tests,
> for developers to quickly repeat the problem.

there are already two ways to run selected tests:
- tell t/TEST to only run certain tests:
  t/TEST t/modules/cgi t/modules/rewrite

- create a t/SKIP file with passing tests
  setenvif.t
  access.t
  etc.t




Winnow?

2001-10-20 Thread William A. Rowe, Jr.
Could be cool if -winnow or some other arg would run only failed tests,
for developers to quickly repeat the problem.

Only problem with that theory ... we force a reconfig every time httpd's
date stamp changes :)

Bill



Re: [important] you must prefix printed debug/info comments in Perl tests with #

2001-10-20 Thread Stas Bekman
Rodent of Unusual Size wrote:
Stas Bekman wrote:
Which means that we should gradually change all the tests
to start the comments with '#', or they may break in the future.
Does that include things like the "debug: " messages in expires.t?
Or are such immune or don't count?
Anything that you print to STDOUT, which then can interfere with some 
already reserved patterns and those that may be introduced in the future 
versions of Test::Harness.

Apache::Test is a very elaborate framework, but at the end all the 
output it generates is fed to Test::Harness, which used not to care 
about comments without leading # (at least as long as I remember using 
it). I guess that sometimes parts of the debug comment may be 
interpreted as a control stream like in: 'testing ok 1' , which can be 
interpreted as 'ok 1', when you just meant a comment.

Also take a look at the tests using t_cmp() from Apache::TestUtil, it 
saves you a lot of typing and I'm planning to change it to print the 
debug statements only if the sub-test fails. It will also handle the # 
thing soon, so the test doesn't look cluttered and easy to read. Just say:

use Apache::TestUtil;
ok t_cmp($expected, $received, "comment");
Also see the doc I'm working on referenced from 
perl-framework/Apache-Test/README, it covers this and other things.

_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: [important] you must prefix printed debug/info comments in Perl tests with #

2001-10-20 Thread Rodent of Unusual Size
Stas Bekman wrote:
> 
> Which means that we should gradually change all the tests
> to start the comments with '#', or they may break in the future.

Does that include things like the "debug: " messages in expires.t?
Or are such immune or don't count?
-- 
#kenP-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist  http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"


Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestUtil.pm

2001-10-20 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
dougm   01/10/19 22:02:05
  Modified:perl-framework/Apache-Test/lib/Apache TestUtil.pm
  Log:
  function to write a shell script for unix, bat for win32
...
  +sub write_shell_script {

shouldn't this be t_write_shell_script in complience with the naming of other methods in this module? 

Or is it ok, since it's not exported?

_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


[important] you must prefix printed debug/info comments in Perl tests with #

2001-10-20 Thread Stas Bekman
The following affects all Perl tests writers.
I've read the latest Test::Harness pod, and it includes the following:
   Comments
   Additional comments may be put into the testing output
   on their own lines.  Comment lines should begin with a
   '#', Test::Harness will ignore them.
 ok 1
 # Life is good, the sun is shining, RAM is cheap.
 not ok 2
 # got 'Bush' expected 'Gore'
   Anything else
   Any other output Test::Harness sees it will silently
   ignore BUT WE PLAN TO CHANGE THIS! If you wish to
   place additional output in your test script, please
   use a comment.
Which means that we should gradually change all the tests to start the 
comments with '#', or they may break in the future. And of course write 
new tests using '#'.

The tests that have been using Apache::TestUtil::t_cmp() don't have to 
change anything at all. I'll fix t_cmp() to prefix # on its comment output.

Those who change their tests, please port the tests to use t_cmp() and 
then it'll be fixed automatically for you.

_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: perldb

2001-10-20 Thread Stas Bekman
Doug MacEachern wrote:
to help with debugging tests, you can run under the perldebugger
% t/TEST -v -d perl t/modules/cgi.t 

...
  DB<1> lwpd 1
will turn on debug mode so Apache::TestRequest prints the request method
and url, along with the response headers from the server.  'lwp 2' does
the same, but includes response body.  any non \d argument triggers a call
to LWP::Debug::import, "lwp '+'" for example, see 'perldoc LWP::Debug' for
more info on those options.
i find it handy to set a breakpoint at 'ok', so the debugger stops each
time a test happens:
  DB<2> b ok
  DB<3> c

that doesn't seem to work
% t/TEST -start
% t/TEST -v -d perl t/apache/read.t 
setting ulimit to allow core files
ulimit -c unlimited
exec t/TEST -v -d perl t/apache/read.t

Loading DB routines from perl5db.pl version 1.14
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
Apache::TestPerlDB added perldb commands:
  bok - Set breakpoint at test n
  lwpd - Set the LWP debug level for Apache::TestRequest
Debugged program terminated.  Use q to quit or R to restart,
 use O inhibit_exit to avoid stopping after program termination,
 h q, h R or h O to get additional info.  
 DB<1> lwpd 1
Undefined subroutine &Apache::TestRequest::lwp_debug called at ../Apache-Test/lib/Apache/TestPerlDB.pm line 5.

 DB<2> b ok
Subroutine main::ok not found.

--
_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: is this a know issue

2001-10-20 Thread Stas Bekman
clayton cottingham wrote:
heya:
i thought id check out the new cvs
of the Apache-Test
i think i might have found a bug?
i do this:
 perl Makefile.PL apxs /usr/local/apache/bin/apxs 
 make
 make test

all options should be prepended with leading -, please read README. This 
change is recent.

perl Makefile.PL -apxs /usr/local/apache/bin/apxs

and then this occurs
no test server configured, please specify an httpd or apxs or put either
in your PATH
so i tried this
./t/TEST httpd /usr/local/apache/bin/httpd -start
and got this:
unknown opts or test names: httpd /usr/local/apache/bin/httpd
whoa !!!

yup, great. just use the leading -.

just thought i should pass it on

bash-2.04$ uname -a
Linux clayton-cottingham.imc 2.2.17-21mdk #1 Thu Oct 5 13:16:08 CEST
2000 i686 unknown
bash-2.04$ perl -v 

This is perl, v5.6.0 built for i386-linux
Copyright 1987-2000, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to
the
Internet, point your browser at http://www.perl.com/, the Perl Home
Page.
bash-2.04$ httpd -v
bash: httpd: command not found
bash-2.04$ /usr/local/apache/bin/httpd -v
Server version: Apache/1.3.12 (Unix)
Server built:   May 31 2001 11:55:18

--
_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: cvs commit: httpd-test/perl-framework/t/modules env.t

2001-10-20 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
dougm   01/10/19 17:54:14
  Modified:perl-framework/t/modules env.t
  Log:
  fix for win32; s/[\r\n]+// rather than chomp

May be keeping chomp and setting $/ to \r\n for WIN? I thought chomp 
will do the right thing on any platform. I know that it just removes $/, 
but shouldn't it by default be set to \r\n on WIN and \r on Mac?


  Revision  ChangesPath
  1.10  +1 -1  httpd-test/perl-framework/t/modules/env.t
  
  Index: env.t
  ===
  RCS file: /home/cvs/httpd-test/perl-framework/t/modules/env.t,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- env.t	2001/09/18 15:41:03	1.9
  +++ env.t	2001/10/20 00:54:14	1.10
  @@ -29,7 +29,7 @@
   $expected = $test{$_} || 'ERROR EXPECTED UNDEFINED';
   sok {
   $actual = GET_BODY "/modules/env/$_.shtml";
  -chomp $actual;
  +$actual =~ s/[\r\n]+$//s;
   print "$_: EXPECT ->$expected<- ACTUAL ->$actual<-\n";
   return $actual eq $expected;
   };
  
  
  


--
_
Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/