Re: [PATCH] make test TEST_VERBOSE=1

2002-09-19 Thread Geoffrey Young

Doug MacEachern wrote:
On Wed, 18 Sep 2002, Doug MacEachern wrote:

On Wed, 18 Sep 2002, Geoffrey Young wrote:

I think the attached patch behaves as suggested.
perfectly, thanks.

with 5.8.0 that is.  with 5.6.1, dies with:
Error in option spec: "verbose:1"
drat.
if I have some more time I'll look for a way to make it back compat to 
at least 5.6.0.

--Geoff



Re: [PATCH] make test TEST_VERBOSE=1

2002-09-18 Thread Doug MacEachern
On Wed, 18 Sep 2002, Doug MacEachern wrote:

> On Wed, 18 Sep 2002, Geoffrey Young wrote:
>  
> > I think the attached patch behaves as suggested.
> 
> perfectly, thanks.

with 5.8.0 that is.  with 5.6.1, dies with:
Error in option spec: "verbose:1"




Re: [PATCH] make test TEST_VERBOSE=1

2002-09-18 Thread Doug MacEachern
On Wed, 18 Sep 2002, Geoffrey Young wrote:
 
> I think the attached patch behaves as suggested.

perfectly, thanks.



Re: [PATCH] make test TEST_VERBOSE=1

2002-09-18 Thread Geoffrey Young

Doug MacEachern wrote:
return $preamble . <<'EOF';
+ifdef TEST_VERBOSE
+  override TEST_VERBOSE = -verbose
+endif

pretty sure ifdef/endif/override/ifeq are not portable (gmake-isms)
ah, right.
better to have the Makefile run 't/TEST -verbose=$(TEST_VERBOSE)'
of course, would still want 't/TEST -v' to work as it does now (turning 
verbose on).  -verbose=0 should be off and -verbose=1 on if possible.
I think the attached patch behaves as suggested.
--Geoff
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.pm18 Sep 2002 18:33:04 -
@@ -44,6 +44,8 @@
 EOF
 
 return $preamble . <<'EOF';
+TEST_VERBOSE = 0
+
 test_clean :
$(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
t/TEST -clean
@@ -51,7 +53,7 @@
 run_tests : test_clean
$(PASSENV) \
$(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
-   t/TEST
+   t/TEST -verbose=$(TEST_VERBOSE)
 
 test :: pure_all run_tests test_clean
 
Index: lib/Apache/TestRun.pm
===
RCS file: 
/home/cvspublic/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.93
diff -u -r1.93 TestRun.pm
--- lib/Apache/TestRun.pm   21 Jun 2002 03:17:51 -  1.93
+++ lib/Apache/TestRun.pm   18 Sep 2002 18:33:05 -
@@ -22,9 +22,10 @@
 my %core_files  = ();
 
 my @std_run  = qw(start-httpd run-tests stop-httpd);
-my @others   = qw(verbose configure clean help ssl http11);
+my @others   = qw(configure clean help ssl http11);
 my @flag_opts= (@std_run, @others);
 my @string_opts  = qw(order trace);
+my @vary_opts= qw(verbose);
 my @ostring_opts = qw(proxy ping);
 my @debug_opts   = qw(debug);
 my @num_opts = qw(times);
@@ -166,6 +167,7 @@
 GetOptions(\%opts, @flag_opts, @help_opts,
(map "$_:s", @debug_opts, @request_opts, @ostring_opts),
(map "$_=s", @string_opts),
+   (map "$_:1", @vary_opts),
(map "$_=i", @num_opts),
(map { ("$_=s", $vopts{$_} ||= []) } @list_opts),
(map { ("$_=s", $vopts{$_} ||= {}) } @hash_opts));


Re: [PATCH] make test TEST_VERBOSE=1

2002-09-17 Thread Doug MacEachern
>  return $preamble . <<'EOF';
> +ifdef TEST_VERBOSE
> +  override TEST_VERBOSE = -verbose
> +endif

pretty sure ifdef/endif/override/ifeq are not portable (gmake-isms)

better to have the Makefile run 't/TEST -verbose=$(TEST_VERBOSE)'

of course, would still want 't/TEST -v' to work as it does now (turning 
verbose on).  -verbose=0 should be off and -verbose=1 on if possible.




[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