The test script at the bottom, is part of a soon to be released update to IO::Pager, once I can solve this problem. The tests behave as expected when invoked from the command line, but fail when invoked via make test or the equivalent command that invokes:
% perl -Mblib t/9-open.t
ok 1 - PAGER undefined since find_pager()
ok 2 - Could not create pipe
1..2
% perl -MExtUtils::Command::MM -e "test_harness (1, 'blib/lib', 'blib/arch' ) " t/9-open.t #-w gives no insight either
t/9-open.t .. 
not ok 1 - PAGER undefined since find_pager()

#   Failed test 'PAGER undefined since find_pager()'
#   at t/9-open.t line 10.
#                   ''
#     doesn't match '(?-xism:The PAGER environment variable is not defined)'
not ok 2 - Could not create pipe

#   Failed test 'Could not create pipe'
#   at t/9-open.t line 14.
#                   ''
#     doesn't match '(?-xism:Could not pipe to PAGER)'
1..2
# Looks like you failed 2 tests of 2.
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests 

Test Summary Report
-------------------
t/9-open.t (Wstat: 512 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2
Files=1, Tests=2,  0 wallclock secs ( 0.05 usr  0.01 sys +  0.23 cusr  0.02 csys =  0.31 CPU)
Result: FAIL
Failed 1/1 test programs. 2/2 subtests failed.
The test script
use strict; use warnings; use Test::More; use t::TestUtils; use IO::Pager; undef $ENV{PAGER}; eval{ my $token = new IO::Pager }; like($@, qr/The PAGER environment variable is not defined/, 'PAGER und +efined since find_pager()'); $ENV{PAGER} = '/dev/null'; eval{ my $token = new IO::Pager or die $!}; like($@, qr/Could not pipe to PAGER/, 'Could not create pipe'); done_testing;
If you want the whole environment to debug, you can access the code at https://github.com/fangly/io-pager/

TIA!

UPDATE: To clarify, these tests are purposefully setting up conditions for object instantiation to fail, and verifying that the expected/documented errors occur. Nothing really happens in the intervening code, other than seemingly unrelated checks to see if we are connected to a TTY.

--
In Bob We Trust, All Others Bring Data.


In reply to Otherwise successful test fails under test_harness by belg4mit

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.