[PATCH] make test TEST_VERBOSE=1

2002-09-17 Thread Geoffrey Young
hi all...
  today I took a stab at fixing a nit that's bothered me for a while...
  $ make test TEST_VERBOSE=1
doesn't work with the Apache::Test stuff.  I know I can run tests 
individually with the -verbose flag, but I didn't see any reason why 
Apache::Test can't follow the standard ExtUtils::MakeMaker pattern and 
let me see all the tests (in verbose mode) at once.

the attached patch offers a solution.  the only problem I can see with 
it is that TEST_VERBOSE=0 actually triggers the verbosity, but I 
figured that it was a trade-off between that and a few extra ifeq 
statements cluttering up the code.

I tested the patch against the test suite for Apache::Test proper and 
mod_perl - both worked just fine with and without TEST_VERBOSE 
populated.  (some output below)

--Geoff
[EMAIL PROTECTED] Apache-Test]$ make test TEST_VERBOSE=1
/src/bleedperl/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -clean
APACHE_USER= APACHE_GROUP= APACHE_PORT= 
APACHE=/usr/local/apache/bin/httpd APXS= \
/src/bleedperl/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -verbose
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -verbose
/usr/local/apache/bin/httpd -X -d 
/src/httpd-test/perl-framework/Apache-Test/t -f 
/src/httpd-test/perl-framework/Apache-Test/t/conf/httpd.conf -DAPACHE1 
-DPERL_USEITHREADS
using Apache/1.3.27-dev

waiting for server to start: ..
waiting for server to start: ok (waited 1 secs)
server localhost:8529 started
ping...1..3
# Running under perl version 5.009 for linux
# Current time local: Tue Sep 17 19:38:30 2002
# Current time GMT:   Tue Sep 17 15:38:30 2002
# Using Test.pm version 1.21
ok 1
ok 2
ok 3
ok
request1..9
# Running under perl version 5.009 for linux
# Current time local: Tue Sep 17 19:38:35 2002
# Current time GMT:   Tue Sep 17 15:38:35 2002
# Using Test.pm version 1.21
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok
All tests successful.
Files=2, Tests=12, 12 wallclock secs ( 5.84 cusr +  0.40 csys =  6.24 CPU)
*** server localhost:8529 shutdown
[EMAIL PROTECTED] Apache-Test]$ make test
/src/bleedperl/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -clean
APACHE_USER= APACHE_GROUP= APACHE_PORT= 
APACHE=/usr/local/apache/bin/httpd APXS= \
/src/bleedperl/bin/perl -Iblib/arch -Iblib/lib \
t/TEST
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST
/usr/local/apache/bin/httpd -X -d 
/src/httpd-test/perl-framework/Apache-Test/t -f 
/src/httpd-test/perl-framework/Apache-Test/t/conf/httpd.conf -DAPACHE1 
-DPERL_USEITHREADS
using Apache/1.3.27-dev

waiting for server to start: .
waiting for server to start: ok (waited 0 secs)
server localhost:8529 started
ping...ok 

requestok 

All tests successful.
Files=2, Tests=12, 13 wallclock secs ( 6.01 cusr +  0.23 csys =  6.24 CPU)
*** server localhost:8529 shutdown
? verbose.patch
? lib/Apache/TestMM.log
? lib/Apache/assbackwards.patch
Index: lib/Apache/TestMM.pm
===
RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm,v
retrieving revision 1.16
diff -u -r1.16 TestMM.pm
--- lib/Apache/TestMM.pm9 Apr 2002 07:38:57 -   1.16
+++ lib/Apache/TestMM.pm17 Sep 2002 19:32:03 -
@@ -44,6 +44,10 @@
 EOF
 
 return $preamble . 'EOF';
+ifdef TEST_VERBOSE
+  override TEST_VERBOSE = -verbose
+endif
+
 test_clean :
$(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
t/TEST -clean
@@ -51,7 +55,7 @@
 run_tests : test_clean
$(PASSENV) \
$(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
-   t/TEST
+   t/TEST $(TEST_VERBOSE)
 
 test :: pure_all run_tests test_clean
 


Re: POST with no data

2002-09-17 Thread Doug MacEachern
i think lwp does the right thing, but TestRequest.pm does not.
patch below should fix (untested).

--- Apache-Test/lib/Apache/TestRequest.pm   4 Apr 2002 00:54:26 -  1.71
+++ Apache-Test/lib/Apache/TestRequest.pm   17 Sep 2002 20:22:38 -
@@ -251,7 +251,7 @@
 $credentials{$keep-{realm} || '__ALL__'} =
   [$keep-{username}, $keep-{password}];
 }
-if (my $content = $keep-{content}) {
+if (defined(my $content = $keep-{content})) {
 if ($content eq '-') {
 $content = join '', STDIN;
 }





Re: minor change needed in mod_test_apr_uri.c

2002-09-17 Thread Doug MacEachern
On Mon, 16 Sep 2002, Dave Hill wrote:

 
 Hi,
   Just starting to use the test framework on Tru64. Bumped into
 a compiler issue... Our compiler does not like multiline implicite strings.
 You can do muliline strings, you just need to end them with '\n\'. Attached
 is a diff -c of my change. I belive that the the change should work with
 other compilers.

thanks, applied to cvs.

p.s.
if possible, diff -u is the prefered format for patches.



Re: newbie question on perl-framework...

2002-09-17 Thread David Hill

 any of the c-modules/ *.so should be added to httpd.conf and config
 within, e.g. from mod_test_apr_uri.c:
 #if CONFIG_FOR_HTTPD_TEST

 Location /test_apr_uri
SetHandler test-apr-uri
 /Location

 #endif

 tests should be skipped if the module is not compiled/loaded.
 you might just need to:

 t/TEST -clean

 then t/TEST again.

Tried that (twice) and it did not help.
Thanks for the pointer to the config blocks, missed that in my
RTFM-ing.

If I hand hack a conf file based on your pointer, things run much
better, but what a pain

I am beginning to think that the problem is related to the path to the
libraries created by apxs.
The DSO is created as ./c-modules/foo/.libs/libmod_foo.so
I am trying to understand the perl code but have not found anything
that deals with this stuff.

Still rooting around but any more suggestions would be appreciated.

thanks.,
Dave Hill