Skip Menu |

This queue is for tickets about the Test-Harness CPAN distribution.

Report information
The Basics
Id: 118616
Status: open
Priority: 0/
Queue: Test-Harness

People
Owner: Nobody in particular
Requestors: jkeen [...] verizon.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Does HARNESS_VERBOSE=1 no longer work?
Date: Thu, 03 Nov 2016 18:09:20 -0400
To: bug-test-harness [...] rt.cpan.org
From: James E Keenan <jkeen [...] verizon.net>
Going back more than a decade, before Andy Lester had written 'prove' and advocated its use, I was accustomed, when testing my CPAN-style libraries, to saying the following to get verbose output from tests: ##### perl Makefile.PL make HARNESS_VERBOSE=1 make test ##### Once 'prove' came on the scene, I mostly said; ##### prove -vb t/*.t ##### Today I had occasion to try HARNESS_VERBOSE anew. According to the documentation here, https://metacpan.org/pod/Test::Harness#HARNESS_VERBOSE, I expected it to work as it did in 2002. But whether I first created and exported an environmental variable or set it on the command-line, I did not get verbose output from 'make test': ##### [parse-taxonomy] 2 $ export HARNESS_VERBOSE=1 [parse-taxonomy] 3 $ echo $HARNESS_VERBOSE 1 [parse-taxonomy] 4 $ perl Makefile.PL Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Parse::Taxonomy Writing MYMETA.yml and MYMETA.json [parse-taxonomy] 5 $ grep -in VERBOSE Makefile 237:MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- 864:TEST_VERBOSE=0 883: PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) 891: PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) ##### Note the absence of the string 'HARNESS_VERBOSE' in the Makefile, as well as the fact that TEST_VERBOSE is set to a false value. ##### [parse-taxonomy] 6 $ make cp lib/Parse/Taxonomy/AdjacentList.pm blib/lib/Parse/Taxonomy/AdjacentList.pm cp lib/Parse/Taxonomy/MaterializedPath.pm blib/lib/Parse/Taxonomy/MaterializedPath.pm cp .version_info.pl blib/lib/Parse/.version_info.pl cp lib/Parse/Taxonomy/Auxiliary.pm blib/lib/Parse/Taxonomy/Auxiliary.pm cp lib/Parse/Taxonomy/Cookbook.pod blib/lib/Parse/Taxonomy/Cookbook.pod cp lib/Parse/Taxonomy.pm blib/lib/Parse/Taxonomy.pm Manifying 5 pod documents [parse-taxonomy] 7 $ make test PERL_DL_NONLAZY=1 "/home/jkeenan/perl5/perlbrew/perls/perl-5.24.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/000-test-prep.t ......... ok t/001-new-file.t .......... ok t/002-new-components.t .... ok t/003-getters.t ........... ok t/004-hashify-taxonomy.t .. ok t/005-adjacentify.t ....... ok t/500-test-prep.t ......... ok t/501-new.t ............... ok t/502-getters.t ........... ok t/503-pathify.t ........... ok All tests successful. Files=10, Tests=491, 0 wallclock secs ( 0.07 usr 0.01 sys + 0.47 cusr 0.03 csys = 0.58 CPU) Result: PASS ##### ##### [parse-taxonomy] 8 $ HARNESS_VERBOSE=1 make test PERL_DL_NONLAZY=1 "/home/jkeenan/perl5/perlbrew/perls/perl-5.24.0/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/000-test-prep.t ......... ok t/001-new-file.t .......... ok t/002-new-components.t .... ok t/003-getters.t ........... ok t/004-hashify-taxonomy.t .. ok t/005-adjacentify.t ....... ok t/500-test-prep.t ......... ok t/501-new.t ............... ok t/502-getters.t ........... ok t/503-pathify.t ........... ok All tests successful. Files=10, Tests=491, 1 wallclock secs ( 0.07 usr 0.01 sys + 0.46 cusr 0.04 csys = 0.58 CPU) Result: PASS ##### HARNESS_VERBOSE=1 did not DWIM. Has it changed, or am I missing something? Thank you very much. Jim Keenan
On Thu Nov 03 18:09:56 2016, jkeen@verizon.net wrote: Show quoted text
> Going back more than a decade, before Andy Lester had written 'prove' > and advocated its use, I was accustomed, when testing my CPAN-style > libraries, to saying the following to get verbose output from tests: > > ##### > perl Makefile.PL > make > HARNESS_VERBOSE=1 make test > ##### > > Once 'prove' came on the scene, I mostly said; > > ##### > prove -vb t/*.t > ##### > > Today I had occasion to try HARNESS_VERBOSE anew. According to the > documentation here, > https://metacpan.org/pod/Test::Harness#HARNESS_VERBOSE, I expected it to > work as it did in 2002. But whether I first created and exported an > environmental variable or set it on the command-line, I did not get > verbose output from 'make test': > > ##### > [parse-taxonomy] 2 $ export HARNESS_VERBOSE=1 > [parse-taxonomy] 3 $ echo $HARNESS_VERBOSE > 1 > [parse-taxonomy] 4 $ perl Makefile.PL > Checking if your kit is complete... > Looks good > Generating a Unix-style Makefile > Writing Makefile for Parse::Taxonomy > Writing MYMETA.yml and MYMETA.json > [parse-taxonomy] 5 $ grep -in VERBOSE Makefile > 237:MOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install([ > from_to => {@ARGV}, verbose => '\''$(VERBINST)'\'', uninstall_shadows => > '\''$(UNINST)'\'', dir_mode => '\''$(PERM_DIR)'\'' ]);' -- > 864:TEST_VERBOSE=0 > 883: PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" > "-MTest::Harness" "-e" "undef *Test::Harness::Switches; > test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" > $(TEST_FILES) > 891: PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" > "-MTest::Harness" "-e" "undef *Test::Harness::Switches; > test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" > $(TEST_FILES) > ##### > > Note the absence of the string 'HARNESS_VERBOSE' in the Makefile, as > well as the fact that TEST_VERBOSE is set to a false value. > > ##### > [parse-taxonomy] 6 $ make > cp lib/Parse/Taxonomy/AdjacentList.pm > blib/lib/Parse/Taxonomy/AdjacentList.pm > cp lib/Parse/Taxonomy/MaterializedPath.pm > blib/lib/Parse/Taxonomy/MaterializedPath.pm > cp .version_info.pl blib/lib/Parse/.version_info.pl > cp lib/Parse/Taxonomy/Auxiliary.pm blib/lib/Parse/Taxonomy/Auxiliary.pm > cp lib/Parse/Taxonomy/Cookbook.pod blib/lib/Parse/Taxonomy/Cookbook.pod > cp lib/Parse/Taxonomy.pm blib/lib/Parse/Taxonomy.pm > Manifying 5 pod documents > [parse-taxonomy] 7 $ make test > PERL_DL_NONLAZY=1 > "/home/jkeenan/perl5/perlbrew/perls/perl-5.24.0/bin/perl" > "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef > *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t > t/000-test-prep.t ......... ok > t/001-new-file.t .......... ok > t/002-new-components.t .... ok > t/003-getters.t ........... ok > t/004-hashify-taxonomy.t .. ok > t/005-adjacentify.t ....... ok > t/500-test-prep.t ......... ok > t/501-new.t ............... ok > t/502-getters.t ........... ok > t/503-pathify.t ........... ok > All tests successful. > Files=10, Tests=491, 0 wallclock secs ( 0.07 usr 0.01 sys + 0.47 cusr > 0.03 csys = 0.58 CPU) > Result: PASS > ##### > > > ##### > [parse-taxonomy] 8 $ HARNESS_VERBOSE=1 make test > PERL_DL_NONLAZY=1 > "/home/jkeenan/perl5/perlbrew/perls/perl-5.24.0/bin/perl" > "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef > *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t > t/000-test-prep.t ......... ok > t/001-new-file.t .......... ok > t/002-new-components.t .... ok > t/003-getters.t ........... ok > t/004-hashify-taxonomy.t .. ok > t/005-adjacentify.t ....... ok > t/500-test-prep.t ......... ok > t/501-new.t ............... ok > t/502-getters.t ........... ok > t/503-pathify.t ........... ok > All tests successful. > Files=10, Tests=491, 1 wallclock secs ( 0.07 usr 0.01 sys + 0.46 cusr > 0.04 csys = 0.58 CPU) > Result: PASS > ##### > > HARNESS_VERBOSE=1 did not DWIM. > > Has it changed, or am I missing something? > > Thank you very much. > Jim Keenan
The zero argument to test_harness() explicitly sets the verbosity to zero; thus overriding HARNESS_VERBOSE=1. I think I'd call this is an ExtUtils::MakeMaker issue, not a Test::Harness one. `make test TEST_VERBOSE=1` should DWIM anyway, on old and new MakeMakers. Leon