Thread: [Module-build-general] verbose and Test::Harness
Status: Beta
Brought to you by:
kwilliams
|
From: Dave R. <au...@ur...> - 2002-08-23 17:11:03
|
There's a number of different versions of Test::Harness out there, and at
least with the one installed on my system (2.24), "Build test verbose=1"
does not actually lead to verbose output. This patch fixes that while
still preserving the old code, which presumably works with some versions
of Test::Harness.
This also does the same thing for test 'switches', on the theory that it
can't hurt. I'm not really sure how to test this.
-dave
diff -wru ../Module-Build-0.11/lib/Module/Build/Base.pm ./lib/Module/Build/Base.pm
--- ../Module-Build-0.11/lib/Module/Build/Base.pm 2002-08-24 00:58:27.000000000 +0800
+++ ./lib/Module/Build/Base.pm 2002-08-24 01:08:10.000000000 +0800
@@ -563,9 +563,16 @@
$self->depends_on('build');
- local $Test::Harness::switches = '-w -d' if $self->{properties}{debugger};
- local $Test::Harness::verbose = $self->{properties}{verbose} || 0;
- local $ENV{TEST_VERBOSE} = $self->{properties}{verbose} || 0;
+ local ($Test::Harness::switches,
+ $Test::Harness::Switches,
+ $ENV{HARNESS_PERL_SWITCHES}) = ('-w -d') x 2
+ if $self->{properties}{debugger};
+
+ my $verbose = $self->{properties}{verbose} || 0;
+
+ local ($Test::Harness::verbose,
+ $Test::Harness::Verbose,
+ $ENV{TEST_VERBOSE},
+ $ENV{HARNESS_VERBOSE}) = ($verbose) x 4;
# Make sure we test the module in blib/
{
|
|
From: Ken W. <ke...@ma...> - 2002-10-29 23:31:28
|
Heya,
I'm about to apply a form of this patch. I want to make sure I
understand it.
On Friday, August 23, 2002, at 12:10 PM, Dave Rolsky wrote:
> There's a number of different versions of Test::Harness out there, and
> at
> least with the one installed on my system (2.24), "Build test verbose=1"
> does not actually lead to verbose output. This patch fixes that while
> still preserving the old code, which presumably works with some versions
> of Test::Harness.
Yeah, "Build test verbose=1" produces verbose output for me. Someone
else told me that it didn't for them, though, so I know you're not alone.
>
> This also does the same thing for test 'switches', on the theory that it
> can't hurt. I'm not really sure how to test this.
One sort of ugly way would be to invoke a 'Build test verbose=1' process
and see whether it really is verbose. Or we could isolate the code that
generates the Test::Harness verbosity options, and test that it works by
sending those options directly to a Test::Harness process. That would
be better. Maybe it wouldn't even require a subprocess?
> diff -wru ../Module-Build-0.11/lib/Module/Build/Base.pm
> ./lib/Module/Build/Base.pm
> --- ../Module-Build-0.11/lib/Module/Build/Base.pm 2002-08-24
> 00:58:27.000000000 +0800
> +++ ./lib/Module/Build/Base.pm 2002-08-24 01:08:10.000000000 +0800
> @@ -563,9 +563,16 @@
>
> $self->depends_on('build');
>
> - local $Test::Harness::switches = '-w -d' if
> $self->{properties}{debugger};
> - local $Test::Harness::verbose = $self->{properties}{verbose} || 0;
> - local $ENV{TEST_VERBOSE} = $self->{properties}{verbose} || 0;
> + local ($Test::Harness::switches,
> + $Test::Harness::Switches,
> + $ENV{HARNESS_PERL_SWITCHES}) = ('-w -d') x 2
> + if $self->{properties}{debugger};
Should be 'x 3', right?
> +
> + my $verbose = $self->{properties}{verbose} || 0;
> +
> + local ($Test::Harness::verbose,
> + $Test::Harness::Verbose,
> + $ENV{TEST_VERBOSE},
> + $ENV{HARNESS_VERBOSE}) = ($verbose) x 4;
So, your version of Test::Harness uses $Verbose instead of $verbose?
I'm looking at T::H version 1.1604, which exports $verbose.
Where are the HARNESS_VERBOSE and HARNESS_PERL_SWITCHES variables used?
I can't find 'em in my @INC.
-Ken
|
|
From: Dave R. <au...@ur...> - 2002-10-29 23:36:48
|
On Tue, 29 Oct 2002, Ken Williams wrote:
> I'm about to apply a form of this patch. I want to make sure I
> understand it.
I wish I remembered more about writing it ;)
> Yeah, "Build test verbose=1" produces verbose output for me. Someone
> else told me that it didn't for them, though, so I know you're not alone.
You have the pre-Schwern Test::Harness ;)
> > diff -wru ../Module-Build-0.11/lib/Module/Build/Base.pm
> > ./lib/Module/Build/Base.pm
> > --- ../Module-Build-0.11/lib/Module/Build/Base.pm 2002-08-24
> > 00:58:27.000000000 +0800
> > +++ ./lib/Module/Build/Base.pm 2002-08-24 01:08:10.000000000 +0800
> > @@ -563,9 +563,16 @@
> >
> > $self->depends_on('build');
> >
> > - local $Test::Harness::switches = '-w -d' if
> > $self->{properties}{debugger};
> > - local $Test::Harness::verbose = $self->{properties}{verbose} || 0;
> > - local $ENV{TEST_VERBOSE} = $self->{properties}{verbose} || 0;
> > + local ($Test::Harness::switches,
> > + $Test::Harness::Switches,
> > + $ENV{HARNESS_PERL_SWITCHES}) = ('-w -d') x 2
> > + if $self->{properties}{debugger};
>
> Should be 'x 3', right?
Yes.
> > +
> > + my $verbose = $self->{properties}{verbose} || 0;
> > +
> > + local ($Test::Harness::verbose,
> > + $Test::Harness::Verbose,
> > + $ENV{TEST_VERBOSE},
> > + $ENV{HARNESS_VERBOSE}) = ($verbose) x 4;
>
> So, your version of Test::Harness uses $Verbose instead of $verbose?
> I'm looking at T::H version 1.1604, which exports $verbose.
It claims to _also_ export $verbose (which is aliased to $Verbose), but in
practice I found I needed to set the capitalized version.
> Where are the HARNESS_VERBOSE and HARNESS_PERL_SWITCHES variables used?
> I can't find 'em in my @INC.
In @INC? Huh, why would you expect to find them there?
You should grab a copy of Test::Harness off CPAN and browse through it a
bit. It mentions those ENV vars.
-dave
/*==================
www.urth.org
we await the New Sun
==================*/
|
|
From: Ken W. <ke...@ma...> - 2002-10-30 02:59:56
|
On Tuesday, October 29, 2002, at 05:36 PM, Dave Rolsky wrote: > On Tue, 29 Oct 2002, Ken Williams wrote: >> >> So, your version of Test::Harness uses $Verbose instead of $verbose? >> I'm looking at T::H version 1.1604, which exports $verbose. > > It claims to _also_ export $verbose (which is aliased to $Verbose), but > in > practice I found I needed to set the capitalized version. OK >> Where are the HARNESS_VERBOSE and HARNESS_PERL_SWITCHES variables used? >> I can't find 'em in my @INC. > > In @INC? Huh, why would you expect to find them there? I meant those strings aren't anywhere in the contents of any of the files in my @INC directories. > You should grab a copy of Test::Harness off CPAN and browse through it a > bit. It mentions those ENV vars. OK. -Ken |
|
From: Ken W. <ke...@ma...> - 2002-10-31 21:40:57
|
I've applied this, with a test. Can you try 'Build test' now? For
kicks, also 'Build test verbose=1'.
-Ken
On Friday, August 23, 2002, at 12:10 PM, Dave Rolsky wrote:
> There's a number of different versions of Test::Harness out there, and
> at
> least with the one installed on my system (2.24), "Build test verbose=1"
> does not actually lead to verbose output. This patch fixes that while
> still preserving the old code, which presumably works with some versions
> of Test::Harness.
>
> This also does the same thing for test 'switches', on the theory that it
> can't hurt. I'm not really sure how to test this.
>
>
> -dave
>
>
> diff -wru ../Module-Build-0.11/lib/Module/Build/Base.pm
> ./lib/Module/Build/Base.pm
> --- ../Module-Build-0.11/lib/Module/Build/Base.pm 2002-08-24
> 00:58:27.000000000 +0800
> +++ ./lib/Module/Build/Base.pm 2002-08-24 01:08:10.000000000 +0800
> @@ -563,9 +563,16 @@
>
> $self->depends_on('build');
>
> - local $Test::Harness::switches = '-w -d' if
> $self->{properties}{debugger};
> - local $Test::Harness::verbose = $self->{properties}{verbose} || 0;
> - local $ENV{TEST_VERBOSE} = $self->{properties}{verbose} || 0;
> + local ($Test::Harness::switches,
> + $Test::Harness::Switches,
> + $ENV{HARNESS_PERL_SWITCHES}) = ('-w -d') x 2
> + if $self->{properties}{debugger};
> +
> + my $verbose = $self->{properties}{verbose} || 0;
> +
> + local ($Test::Harness::verbose,
> + $Test::Harness::Verbose,
> + $ENV{TEST_VERBOSE},
> + $ENV{HARNESS_VERBOSE}) = ($verbose) x 4;
>
> # Make sure we test the module in blib/
> {
|