Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 106975
Status: resolved
Worked: 10 min
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: ETJ [...] cpan.org
Requestors: ANDK [...] cpan.org
Cc: ribasushi [...] leporine.io
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in:
  • 7.11_04
  • 7.11_05
  • 7.11_06
  • 7.12



Subject: Broken: make testdb TEST_FILE=...
% git describe v6.99_11-399-gf91b514 % make testdb TEST_FILE=t/make.t PERL_DL_NONLAZY=1 "/home/sand/src/perl/repoperls/installed-perls/perl/v5.23.2-201-gf8fbb01/165a/bin/perl" "-Iblib/arch" "-Iblib/lib" -d "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t Loading DB routines from perl5db.pl version 1.49_01 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch') DB<23> q % This is not how the idiom was working all the years. After downgrading to v7.05_08 the previous behaviour comes back: % make testdb TEST_FILE=t/make.t PERL_DL_NONLAZY=1 "/home/sand/src/perl/repoperls/installed-perls/perl/v5.23.2-201-gf8fbb01/165a/bin/perl" "-Iblib/arch" "-Iblib/lib" -d "-Iblib/lib" "-Iblib/arch" t/make.t Loading DB routines from perl5db.pl version 1.49_01 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. 1..3 main::(t/make.t:11): my $MM = bless { MAKE => "nmake6" }, "MM"; DB<23> q # No tests run! Makefile:956: recipe for target 'testdb_dynamic' failed make: *** [testdb_dynamic] Error 255 % I've bisected down to this commit: commit c5158478701d714ac1420128c6ececa16324484c Author: Ed J <mohawk2@users.noreply.github.com> Date: Fri Jan 23 03:31:48 2015 +0000
This was where I introduced some consistency, which changed things. Before the commit you mention, the Makefile looked like this: test_dynamic :: dynamic PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-MTest::Harn ess" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST _LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) testdb_dynamic :: dynamic PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE) After it, due to a refactoring for DRY, it looked like this: test_dynamic :: dynamic subdirs-test_dynamic 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) testdb_dynamic :: dynamic subdirs-test_dynamic PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES) You will note that in the historical version, testdb_dynamic ran against TEST_FILE (set to test.pl), while test_dynamic ran against TEST_FILES. In the refactored version, they both run against TEST_FILES. I would suggest this is an improvement. You can run tests against specified tests by giving TEST_FILES on the command line. What do you think?
Andreas, on the github issue you said: Show quoted text
> If the idiom is working, I'm a happy user. I'm not coding police. The idiom is not working anymore and as far as I can see there is no replacement.
The replacement is (note plural TEST_FILE*S*): make testdb TEST_FILES=t/02-blah.t "make testdb" without specifying TEST_FILE (note singular) was broken since it tried to use the harness on TEST_FILE (note singular) which was and remains set in the Makefile to "test.pl".
On Fri Sep 11 04:11:12 2015, ETJ wrote: Show quoted text
> Andreas, on the github issue you said:
> > If the idiom is working, I'm a happy user. I'm not coding police. The > > idiom is not working anymore and as far as I can see there is no > > replacement.
> > The replacement is (note plural TEST_FILE*S*): > > make testdb TEST_FILES=t/02-blah.t > > "make testdb" without specifying TEST_FILE (note singular) was broken > since it tried to use the harness on TEST_FILE (note singular) which > was and remains set in the Makefile to "test.pl".
testdb runs the debugger. That's the entire point. Running the debugger against a collection of files doesn't make any sense, nor does running against the harness. testdb was created in the context of a single test.pl file, and doesn't make much sense with multiple t/*.t files. However, it still can be useful if TEST_FILE is manually specified. The "consistency" you've added broke the only use case that it still has.
CC: ANDK [...] cpan.org
Subject: Re: [rt.cpan.org #106975] Broken: make testdb TEST_FILE=...
Date: Sat, 12 Sep 2015 07:46:45 +0200
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
Show quoted text
>>>>> On Fri, 11 Sep 2015 04:11:14 -0400, "Ed J via RT" <bug-ExtUtils-MakeMaker@rt.cpan.org> said:
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=106975 > > Andreas, on the github issue you said:
>> If the idiom is working, I'm a happy user. I'm not coding police. The idiom is not working anymore and as far as I can see there is no replacement.
Show quoted text
> The replacement is (note plural TEST_FILE*S*):
Show quoted text
> make testdb TEST_FILES=t/02-blah.t
Well, I see I got to point out what exactly I mean. To understand my example, please try it with t/make.t directly in your copy of the ExtUtils-MakeMaker git repository. As I do below. Watch carefully in the outputs below that with current sources both an incantation with TEST_FILES=t/make.t and with TEST_FILE=t/make.t loads the harness one-liner which is not what I want. Whereas with v7.05_08 it loads the test script t/make.t immediately which is the behaviour I expect and actually want. Do you see the difference now? In the following you see six prompts, denoted by '(N)%'. The first command (1) is a git command that documents which sources are active locally. Then I call 'make testdb', once with (2) TEST_FILES=t/make.t and once with (3) TEST_FILE=t/make.t. Both start the debugger with the harness oneliner main::(-e:1) undef *Test::Harness::Switches [...] Then the command (4) is again a git command to switch to v7.05_08. You should be able to reproduce this in your repository. And in (5) I call again 'perl makedb' with TEST_FILE=t/make.t. This command produces a bit more output from MakeMaker because we have changed the sources by the git command. Then the command has to be repeated as in (6). The repetition is only necessary once. Please note that with that older MakeMaker the debugger starts directly in the t/make.t script, witness main::(t/make.t:11): my $MM = bless [...] Do you see the difference now? Do you understand the intention of the original code now? (1)% git describe v6.99_11-400-g35e0ee4 (2)% make testdb TEST_FILES=t/make.t PERL_DL_NONLAZY=1 "/home/sand/src/perl/repoperls/installed-perls/perl/v5.23.2-201-gf8fbb01/165a/bin/perl" "-Iblib/arch" "-Iblib/lib" -d "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/make.t Loading DB routines from perl5db.pl version 1.49_01 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch') DB<38> q (3)% make testdb TEST_FILE=t/make.t PERL_DL_NONLAZY=1 "/home/sand/src/perl/repoperls/installed-perls/perl/v5.23.2-201-gf8fbb01/165a/bin/perl" "-Iblib/arch" "-Iblib/lib" -d "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t Loading DB routines from perl5db.pl version 1.49_01 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch') DB<38> q (4)% git checkout v7.05_08 [...] (5)% make testdb TEST_FILE=t/make.t [...] (6)% make testdb TEST_FILE=t/make.t [...] PERL_DL_NONLAZY=1 "/home/sand/src/perl/repoperls/installed-perls/perl/v5.23.2-201-gf8fbb01/165a/bin/perl" "-Iblib/arch" "-Iblib/lib" -d "-Iblib/lib" "-Iblib/arch" t/make.t Loading DB routines from perl5db.pl version 1.49_01 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. 1..3 main::(t/make.t:11): my $MM = bless { MAKE => "nmake6" }, "MM"; DB<38> q # No tests run! Makefile:956: recipe for target 'testdb_dynamic' failed % HTH, -- andreas
It does indeed help! (along with Graham's words) I'll make a test (there is currently no testing at all for testdb behaviour) and a fix.
On Sat Sep 12 10:24:25 2015, ETJ wrote: Show quoted text
> Test and fix in https://github.com/Perl-Toolchain-Gang/ExtUtils- > MakeMaker/commit/ace8b86c6557630a94c8a33d880d77a54c329ebc
Now 7.12 is out, closing this ticket Many thanks.