beyondgrep / ack2

**ack 2 is no longer being maintained. ack 3 is the latest version.**
https://github.com/beyondgrep/ack3/
Other
1.48k stars 138 forks source link

`t/config-loader.t` assumes an empty environment #319

Closed doherty closed 10 years ago

doherty commented 11 years ago

I have LESS_PAGER set, but there is a bug where that is ignored, which I don't think has been fixed yet. So, I set LESS_OPTIONS to achieve the same effect:

ACK_PAGER=less -FRX
ACK_OPTIONS=--pager 'less -FRX'

This causes the config-loader test to fail, as it seems to assume the environment will be empty:

cpan> install App::Ack
Running install for module 'App::Ack'
Running make for P/PE/PETDANCE/ack-2.08.tar.gz
Fetching with LWP:
https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/ack-2.08.tar.gz
Fetching with LWP:
https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/CHECKSUMS
Checksum for /home/mike/.cpan/sources/authors/id/P/PE/PETDANCE/ack-2.08.tar.gz ok
Scanning cache /home/mike/.cpan/build for sizes
............................................................................DONE

  CPAN.pm: Building P/PE/PETDANCE/ack-2.08.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for ack
Writing MYMETA.yml and MYMETA.json
cp Is.pm blib/lib/App/Ack/Filter/Is.pm
cp ConfigDefault.pm blib/lib/App/Ack/ConfigDefault.pm
cp Extension.pm blib/lib/App/Ack/Filter/Extension.pm
cp Match.pm blib/lib/App/Ack/Filter/Match.pm
cp Resources.pm blib/lib/App/Ack/Resources.pm
cp ConfigFinder.pm blib/lib/App/Ack/ConfigFinder.pm
cp Basic.pm blib/lib/App/Ack/Resource/Basic.pm
cp Inverse.pm blib/lib/App/Ack/Filter/Inverse.pm
cp Default.pm blib/lib/App/Ack/Filter/Default.pm
cp Resource.pm blib/lib/App/Ack/Resource.pm
cp Ack.pm blib/lib/App/Ack.pm
cp Filter.pm blib/lib/App/Ack/Filter.pm
cp FirstLineMatch.pm blib/lib/App/Ack/Filter/FirstLineMatch.pm
cp ConfigLoader.pm blib/lib/App/Ack/ConfigLoader.pm
cp ack blib/script/ack
/home/mike/perl5/perlbrew/perls/perl-5.18.0/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/ack
Manifying blib/man1/ack.1
  PETDANCE/ack-2.08.tar.gz
  /usr/bin/make -- OK
Running make test
/home/mike/perl5/perlbrew/perls/perl-5.18.0/bin/perl t/runtests.pl 0 0 "blib/lib" "blib/arch" t/*.t t/lib/*.t
Running tests on blib/script/ack
t/00-load.t .................. 1/1 # Testing App::Ack 2.08, File::Next 1.12, Perl 5.018000, /home/mike/perl5/perlbrew/perls/perl-5.18.0/bin/perl
# Using Test::More 0.98 and Test::Harness 3.26
t/00-load.t .................. ok   
t/ack-1.t .................... ok     
t/ack-c.t .................... ok     
t/ack-color.t ................ ok     
t/ack-column.t ............... ok   
t/ack-create-ackrc.t ......... ok   
t/ack-dump.t ................. ok   
t/ack-f.t .................... ok   
t/ack-files-from.t ........... ok   
t/ack-filetypes.t ............ ok     
t/ack-g.t .................... ok     
t/ack-group.t ................ ok     
t/ack-h.t .................... ok     
t/ack-help-types.t ........... ok     
t/ack-help.t ................. ok     
t/ack-i.t .................... ok   
t/ack-ignore-dir.t ........... ok     
t/ack-interactive.t .......... skipped: You need to install IO::Pty to run this test
t/ack-invalid-ackrc.t ........ skipped: Don't yet have a reliable way to ignore the Unicode complaints from Pod::Perldoc
t/ack-k.t .................... ok   
t/ack-known-types.t .......... ok   
t/ack-line.t ................. skipped: You need to install IO::Pty to run this test
t/ack-m.t .................... ok   
t/ack-match.t ................ ok    
t/ack-n.t .................... ok     
t/ack-named-pipes.t .......... ok   
t/ack-o.t .................... ok   
t/ack-pager.t ................ skipped: You need to install IO::Pty to run this test
t/ack-passthru.t ............. ok   
t/ack-print0.t ............... ok     
t/ack-removed-options.t ...... ok     
t/ack-s.t .................... ok   
t/ack-show-types.t ........... ok   
t/ack-type-del.t ............. ok     
t/ack-type.t ................. ok     
t/ack-v.t .................... ok   
t/ack-w.t .................... ok   
t/ack-x.t .................... ok   
t/anchored.t ................. ok   
t/asp-net-ext.t .............. ok   
t/bad-ackrc-opt.t ............ ok   
t/basic.t .................... ok     
t/command-line-files.t ....... ok   
t/config-backwards-compat.t .. ok   
t/config-finder.t ............ ok     
t/config-loader.t ............ 1/? 
#   Failed test 'Options match'
#   at t/config-loader.t line 100.
#     Structures begin differing at:
#          $got->{pager} = 'less -FRX'
#     $expected->{pager} = undef
# Options did not match

#   Failed test 'Options match'
#   at t/config-loader.t line 106.
#     Structures begin differing at:
#          $got->{pager} = 'less -FRX'
#     $expected->{pager} = undef
# Options did not match

#   Failed test 'Options match'
#   at t/config-loader.t line 113.
#     Structures begin differing at:
#          $got->{pager} = 'less -FRX'
#     $expected->{pager} = undef
# Options did not match

#   Failed test 'Options match'
#   at t/config-loader.t line 120.
#     Structures begin differing at:
#          $got->{pager} = 'less -FRX'
#     $expected->{pager} = undef
# Options did not match

#   Failed test 'Options match'
#   at t/config-loader.t line 127.
#     Structures begin differing at:
#          $got->{pager} = 'less -FRX'
#     $expected->{pager} = undef
# Options did not match

#   Failed test 'Options match'
#   at t/config-loader.t line 212.
#     Structures begin differing at:
#          $got->{pager} = 'less -FRX'
#     $expected->{pager} = undef
# Options did not match
# Looks like you failed 6 tests of 34.
t/config-loader.t ............ Dubious, test returned 6 (wstat 1536, 0x600)
Failed 6/34 subtests 
t/context.t .................. ok     
t/default-filter.t ........... ok   
t/exit-code.t ................ ok   
t/ext-filter.t ............... ok   
t/file-permission.t .......... ok     
t/filetypes.t ................ ok    
t/filter.t ................... ok   
t/firstlinematch-filter.t .... ok   
t/illegal-regex.t ............ ok   
t/incomplete-last-line.t ..... ok   
t/inverted-file-filter.t ..... ok   
t/is-filter.t ................ ok   
t/lib/Ack.t .................. ok   
t/lib/Basic.t ................ ok   
t/lib/ConfigDefault.t ........ ok   
t/lib/ConfigFinder.t ......... ok   
t/lib/ConfigLoader.t ......... ok   
t/lib/Default.t .............. ok   
t/lib/Extension.t ............ ok   
t/lib/Filter.t ............... ok   
t/lib/FirstLineMatch.t ....... ok   
t/lib/Inverse.t .............. ok   
t/lib/Is.t ................... ok   
t/lib/Match.t ................ ok   
t/lib/Resource.t ............. ok   
t/lib/Resources.t ............ ok   
t/longopts.t ................. ok     
t/match-filter.t ............. ok   
t/mutex-options.t ............ ok     
t/noackrc.t .................. ok   
t/noenv.t .................... ok   
t/process-substitution.t ..... ok   
t/r-lang-ext.t ............... ok   
t/resource-iterator.t ........ ok   
t/zero.t ..................... ok   

Test Summary Report
-------------------
t/config-loader.t          (Wstat: 1536 Tests: 34 Failed: 6)
  Failed tests:  1, 3, 5, 7, 9, 29
  Non-zero exit status: 6
Files=81, Tests=1701, 46 wallclock secs ( 0.56 usr  0.16 sys + 36.36 cusr  6.68 csys = 43.76 CPU)
Result: FAIL
Failed 1/81 test programs. 6/1701 subtests failed.
make: *** [test_classic] Error 255
  PETDANCE/ack-2.08.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports PETDANCE/ack-2.08.tar.gz
Running make install
  make test had returned bad status, won't install without force
Stopping: 'install' failed for 'App::Ack'.
Failed during this command:
 PETDANCE/ack-2.08.tar.gz                     : make_test NO