Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fails to complete tests under interix / sfu #123

Closed
stevenh opened this Issue · 10 comments

3 participants

@stevenh

Unfortunately ack seems to fail its tests on interix / sfu:

Build output from perl -MCPAN -e shell; install App::Ack

ack-1.92
ack-1.92/ack
ack-1.92/ack-base
ack-1.92/ack-help-types.txt
ack-1.92/ack-help.txt
ack-1.92/Ack.pm
ack-1.92/Basic.pm
ack-1.92/capture-stderr
ack-1.92/Changes
ack-1.92/etc
ack-1.92/etc/ack.bash_completion.sh
ack-1.92/Makefile.PL
ack-1.92/MANIFEST
ack-1.92/META.yml
ack-1.92/Plugin.pm
ack-1.92/README
ack-1.92/Repository.pm
ack-1.92/Resource.pm
ack-1.92/squash
ack-1.92/t
ack-1.92/t/00-load.t
ack-1.92/t/ack-1.t
ack-1.92/t/ack-a.t
ack-1.92/t/ack-binary.t
ack-1.92/t/ack-c.t
ack-1.92/t/ack-color.t
ack-1.92/t/ack-column.t
ack-1.92/t/ack-env.t
ack-1.92/t/ack-g.t
ack-1.92/t/ack-group.t
ack-1.92/t/ack-h.t
ack-1.92/t/ack-ignore-dir.t
ack-1.92/t/ack-line.t
ack-1.92/t/ack-match.t
ack-1.92/t/ack-o.t
ack-1.92/t/ack-passthru.t
ack-1.92/t/ack-print0.t
ack-1.92/t/ack-text.t
ack-1.92/t/ack-type.t
ack-1.92/t/ack-u.t
ack-1.92/t/ack-v.t
ack-1.92/t/ack-w.t
ack-1.92/t/code.t
ack-1.92/t/command-line-files.t
ack-1.92/t/context.t
ack-1.92/t/encoding.t
ack-1.92/t/etc
ack-1.92/t/etc/buttonhook.html.xxx
ack-1.92/t/etc/buttonhook.noxml.xxx
ack-1.92/t/etc/buttonhook.rfc.xxx
ack-1.92/t/etc/buttonhook.rss.xxx
ack-1.92/t/etc/buttonhook.xml.xxx
ack-1.92/t/etc/core.2112
ack-1.92/t/etc/shebang.empty.xxx
ack-1.92/t/etc/shebang.foobar.xxx
ack-1.92/t/etc/shebang.php.xxx
ack-1.92/t/etc/shebang.pl.xxx
ack-1.92/t/etc/shebang.py.xxx
ack-1.92/t/etc/shebang.rb.xxx
ack-1.92/t/etc/shebang.sh.xxx
ack-1.92/t/file-permission.t
ack-1.92/t/filetypes.t
ack-1.92/t/illegal-regex.t
ack-1.92/t/incomplete-last-line.t
ack-1.92/t/interesting.t
ack-1.92/t/longopts.t
ack-1.92/t/module.t
ack-1.92/t/multiline.t
ack-1.92/t/pod.t
ack-1.92/t/rc.t
ack-1.92/t/standalone.t
ack-1.92/t/swamp
ack-1.92/t/swamp/#emacs-workfile.pl#
ack-1.92/t/swamp/0
ack-1.92/t/swamp/blib
ack-1.92/t/swamp/blib/ignore.pir
ack-1.92/t/swamp/blib/ignore.pm
ack-1.92/t/swamp/blib/ignore.pod
ack-1.92/t/swamp/c-header.h
ack-1.92/t/swamp/c-source.c
ack-1.92/t/swamp/crystallography-weenies.f
ack-1.92/t/swamp/file.bar
ack-1.92/t/swamp/file.foo
ack-1.92/t/swamp/groceries
ack-1.92/t/swamp/groceries/another_subdir
ack-1.92/t/swamp/groceries/another_subdir/CVS
ack-1.92/t/swamp/groceries/another_subdir/CVS/fruit
ack-1.92/t/swamp/groceries/another_subdir/CVS/junk
ack-1.92/t/swamp/groceries/another_subdir/CVS/meat
ack-1.92/t/swamp/groceries/another_subdir/fruit
ack-1.92/t/swamp/groceries/another_subdir/junk
ack-1.92/t/swamp/groceries/another_subdir/meat
ack-1.92/t/swamp/groceries/another_subdir/RCS
ack-1.92/t/swamp/groceries/another_subdir/RCS/fruit
ack-1.92/t/swamp/groceries/another_subdir/RCS/junk
ack-1.92/t/swamp/groceries/another_subdir/RCS/meat
ack-1.92/t/swamp/groceries/CVS
ack-1.92/t/swamp/groceries/CVS/fruit
ack-1.92/t/swamp/groceries/CVS/junk
ack-1.92/t/swamp/groceries/CVS/meat
ack-1.92/t/swamp/groceries/fruit
ack-1.92/t/swamp/groceries/junk
ack-1.92/t/swamp/groceries/meat
ack-1.92/t/swamp/groceries/RCS
ack-1.92/t/swamp/groceries/RCS/fruit
ack-1.92/t/swamp/groceries/RCS/junk
ack-1.92/t/swamp/groceries/RCS/meat
ack-1.92/t/swamp/groceries/subdir
ack-1.92/t/swamp/groceries/subdir/fruit
ack-1.92/t/swamp/groceries/subdir/junk
ack-1.92/t/swamp/groceries/subdir/meat
ack-1.92/t/swamp/html.htm
ack-1.92/t/swamp/html.html
ack-1.92/t/swamp/incomplete-last-line.txt
ack-1.92/t/swamp/javascript.js
ack-1.92/t/swamp/Makefile
ack-1.92/t/swamp/Makefile.PL
ack-1.92/t/swamp/moose-andy.jpg
ack-1.92/t/swamp/not-an-#emacs-workfile#
ack-1.92/t/swamp/notaMakefile
ack-1.92/t/swamp/notaRakefile
ack-1.92/t/swamp/options.pl
ack-1.92/t/swamp/options.pl.bak
ack-1.92/t/swamp/parrot.pir
ack-1.92/t/swamp/perl-test.t
ack-1.92/t/swamp/perl-without-extension
ack-1.92/t/swamp/perl.cgi
ack-1.92/t/swamp/perl.pl
ack-1.92/t/swamp/perl.pm
ack-1.92/t/swamp/perl.pod
ack-1.92/t/swamp/perl.tar.gz
ack-1.92/t/swamp/pipe-stress-freaks.F
ack-1.92/t/swamp/Rakefile
ack-1.92/t/swamp/sample.rake
ack-1.92/t/swamp/solution8.tar
ack-1.92/t/tar.t
ack-1.92/t/text
ack-1.92/t/text/4th-of-july.txt
ack-1.92/t/text/boy-named-sue.txt
ack-1.92/t/text/freedom-of-choice.txt
ack-1.92/t/text/me-and-bobbie-mcgee.txt
ack-1.92/t/text/science-of-myth.txt
ack-1.92/t/text/shut-up-be-happy.txt
ack-1.92/t/Util.pm
ack-1.92/t/zero.t
ack-1.92/TODO
CPAN: File::Temp loaded ok (v0.18)

CPAN.pm: Going to build P/PE/PETDANCE/ack-1.92.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for ack
cp Ack.pm blib/lib/App/Ack.pm
cp Repository.pm blib/lib/App/Ack/Repository.pm
cp Plugin.pm blib/lib/App/Ack/Plugin.pm
cp Resource.pm blib/lib/App/Ack/Resource.pm
cp Basic.pm blib/lib/App/Ack/Plugin/Basic.pm
/bin/perl squash ack-base File::Next Ack.pm Repository.pm Resource.pm Basic.pm > ack
Reading ack-base
Reading /usr/local/lib/perl5/site_perl/5.8.8/File/Next.pm
Reading Ack.pm
Reading Repository.pm
Reading Resource.pm
Reading Basic.pm
chmod 0755 ack
/bin/perl -T -c ack
ack syntax OK
/bin/perl -T ack --noenv --help > ack-help.txt || perl -e0
/bin/perl -T ack --noenv --help=types > ack-help-types.txt || perl -e0
cp ack blib/script/ack
/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/ack
Manifying blib/man1/ack.1
ack:897: Unknown escape E<0x107>
PETDANCE/ack-1.92.tar.gz
/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t ............... 1/4 # Testing App::Ack 1.92, File::Next 1.06, Perl 5.008008, /bin/perl
t/00-load.t ............... ok
t/ack-1.t ................. ok
t/ack-a.t ................. ok
t/ack-binary.t ............ ok
t/ack-c.t ................. ok
t/ack-color.t ............. ok
t/ack-column.t ............ ok
t/ack-env.t ............... ok
t/ack-g.t ................. ok
t/ack-group.t ............. ok
t/ack-h.t ................. ok
t/ack-ignore-dir.t ........ ok
t/ack-line.t .............. ok
t/ack-match.t ............. ok
t/ack-o.t ................. ok
t/ack-passthru.t .......... 5/6

Failed test 'Got all the lines back'

at t/ack-passthru.t line 52.

got: '12426'

expected: '37'

Failed test 'Only two lines are highlighted'

at t/ack-passthru.t line 55.

got: '9'

expected: '2'

Looks like you failed 2 tests of 6.

t/ack-passthru.t .......... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/6 subtests
t/ack-print0.t ............ ok
t/ack-text.t .............. ok
t/ack-type.t .............. ok
t/ack-u.t ................. ok
t/ack-v.t ................. ok
t/ack-w.t ................. ok
t/code.t .................. ok
t/command-line-files.t .... ok
t/context.t ............... 11/22

Failed test 'Only two lines are highlighted'

at t/context.t line 134.

got: '89'

expected: '2'

Failed test 'Expecting altogether 18 lines back'

at t/context.t line 135.

got: '97'

expected: '18'

Looks like you failed 2 tests of 22.

t/context.t ............... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/22 subtests
t/encoding.t .............. ok
t/file-permission.t ....... ok
t/filetypes.t ............. ok
t/illegal-regex.t ......... ok
t/incomplete-last-line.t .. ok
t/interesting.t ........... ok
t/longopts.t .............. ok
t/module.t ................ ok
t/multiline.t ............. ok
t/pod.t ................... ok
t/rc.t .................... ok
t/standalone.t ............ ok
t/tar.t ................... skipped: Testing the uncompleted feature of acking through a tar file.
t/zero.t .................. ok

Test Summary Report

t/ack-passthru.t (Wstat: 512 Tests: 6 Failed: 2)
Failed tests: 5-6
Non-zero exit status: 2
t/context.t (Wstat: 512 Tests: 22 Failed: 2)
Failed tests: 13-14
Non-zero exit status: 2
Files=39, Tests=564, 29 wallclock secs ( 0.30 usr 0.38 sys + 24.34 cusr 15.67 csys = 40.69 CPU)
Result: FAIL
Failed 2/39 test programs. 4/564 subtests failed.
*** Error code 255

Stop.
PETDANCE/ack-1.92.tar.gz
/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
Failed during this command:
PETDANCE/ack-1.92.tar.gz : make_test NO

perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=interix, osvers=3.5, archname=x86-interix-thread-multi
uname='interix squirtle 3.5 sp-8.0.1969.32 x86 intel_x86_family15_model2_stepping7 '
config_args=''
hint=previous, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_ALL_SOURCE -I/usr/local/bind/include -I/usr/local/include',
optimize='-O2',
cppflags='-D_REENTRANT -D_ALL_SOURCE -fno-strict-aliasing -pipe -I/usr/local/include -D_REENTRANT -D_ALL_SOURCE -I/usr/local/bi
d/include -I/usr/local/include -D_REENTRANT -D_ALL_SOURCE -I/usr/local/bind/include -I/usr/local/include'
ccversion='', gccversion='3.3', gccosandvers='interix3'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lsocket -lbind -lgdbm -ldb -ldl -lm -lcrypt -lc -lpthread
perllibs=-lsocket -lbind -ldl -lm -lcrypt -lc -lpthread
libc=, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags=' ', lddlflags='-shared -L/usr/local/lib'

Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT USE_ITHREADS
USE_PERLIO USE_REENTRANT_API
Built under interix
Compiled at May 19 2006 02:11:08
@INC:
/usr/local/lib/perl5/5.8.8/x86-interix-thread-multi
/usr/local/lib/perl5/5.8.8
/usr/local/lib/perl5/site_perl/5.8.8/x86-interix-thread-multi
/usr/local/lib/perl5/site_perl/5.8.8
/usr/local/lib/perl5/site_perl/5.6.1
/usr/local/lib/perl5/site_perl
.

uname -a
Interix test 3.5 SP-8.0.1969.50 x86 Intel_x86_Family6_Model15_Stepping7

@petdance
Owner

I have no idea what interix/sfu is.

@stevenh

http://en.wikipedia.org/wiki/Interix

In short its Microsoft's free posix subsystem, on which I've run everything from mysql, to apache and all the relevant perl modules.

@petdance
Owner

Are you able/willing to help me debug this? This is a system I have no access to.

@stevenh

I can help debug, but I can't provide access I'm afraid.

It is a free download so if you have access to an XP machine you can just grab it from:
http://www.microsoft.com/downloads/details.aspx?familyid=896c9688-601b-44f1-81a4-02878ff11778&displaylang=en

If your on linux etc a vm with the free compat vhd's may also help.

@stevenh
not ok 5 - Automatically fail stderr check for TODO tests. # TODO I can't figure why the -w works from the command line, but not ins
ide this test

#   Failed (TODO) test 'Automatically fail stderr check for TODO tests.'
#   at t/Util.pm line 59.
not ok 6 - Looking for mu. # TODO I can't figure why the -w works from the command line, but not inside this test

#   Failed (TODO) test 'Looking for mu.'
#   at t/ack-w.t line 51.
# +----+--------------------------------------------------------------+----+--------------------------------------------------------
------+
# | Elt|Got                                                           | Elt|Expected
      |
# +----+--------------------------------------------------------------+----+--------------------------------------------------------
------+
# *   0|And he didn't leave very much for my Ma and me                *    |
      |
# |   1|At an old saloon on a street of mud,                          |   0|At an old saloon on a street of mud,
      |
# *   2|He kicked like a mule and he bit like a crocodile.            *    |
      |
# |   3|Kicking and a-gouging in the mud and the blood and the beer.  |   1|Kicking and a-gouging in the mud and the blood and the b
eer.  |
# *   4|Science and religion are not mutually exclusive               *    |
      |
# *   5|Well, he must have thought that it was quite a joke           *    |
      |
# +----+--------------------------------------------------------------+----+--------------------------------------------------------
------+



not ok 13 - Only two lines are highlighted
not ok 14 - Expecting altogether 18 lines back

#   Failed test 'Only two lines are highlighted'
#   at t/context.t line 134.
#          got: '89'
#     expected: '2'

#   Failed test 'Expecting altogether 18 lines back'
#   at t/context.t line 135.
#          got: '97'
#     expected: '18'
@stevenh

The first issue seem to be that:
-p STDIN

Doesn't return 1 on interix :(

It does seem to support -t which you use in the output case so just using that for input seems to fix everything :)

--- ack.orig    Mon Jul 26 20:38:26 2010
+++ ack Mon Jul 26 20:37:01 2010
@@ -1211,7 +1211,7 @@

     # These have to be checked before any filehandle diddling.
     $output_to_pipe  = not -t *STDOUT;
-    $input_from_pipe = -p STDIN;
+    $input_from_pipe = not -t STDIN;

     $is_cygwin       = ($^O eq 'cygwin');
     $is_windows      = ($^O =~ /MSWin32/);

Test results:-
/bin/perl -T ack --noenv --help > ack-help.txt || perl -e0
/bin/perl -T ack --noenv --help=types > ack-help-types.txt || perl -e0
cp ack blib/script/ack
/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/ack
PERL_DL_NONLAZY=1 /bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t ............... 1/4 # Testing App::Ack 1.92, File::Next 1.06, Perl 5.008008, /bin/perl
t/00-load.t ............... ok
t/ack-1.t ................. ok
t/ack-a.t ................. ok
t/ack-binary.t ............ ok
t/ack-c.t ................. ok
t/ack-color.t ............. ok
t/ack-column.t ............ ok
t/ack-env.t ............... ok
t/ack-g.t ................. ok
t/ack-group.t ............. ok
t/ack-h.t ................. ok
t/ack-ignore-dir.t ........ ok
t/ack-line.t .............. ok
t/ack-match.t ............. ok
t/ack-o.t ................. ok
t/ack-passthru.t .......... ok
t/ack-print0.t ............ ok
t/ack-text.t .............. ok
t/ack-type.t .............. ok
t/ack-u.t ................. ok
t/ack-v.t ................. ok
t/ack-w.t ................. ok
t/code.t .................. ok
t/command-line-files.t .... ok
t/context.t ............... ok
t/encoding.t .............. ok
t/file-permission.t ....... ok
t/filetypes.t ............. ok
t/illegal-regex.t ......... ok
t/incomplete-last-line.t .. ok
t/interesting.t ........... ok
t/longopts.t .............. ok
t/module.t ................ ok
t/multiline.t ............. ok
t/pod.t ................... ok
t/rc.t .................... ok
t/standalone.t ............ ok
t/tar.t ................... skipped: Testing the uncompleted feature of acking through a tar file.
t/zero.t .................. ok
All tests successful.
Files=39, Tests=564, 28 wallclock secs ( 0.42 usr 0.33 sys + 24.56 cusr 15.25 csys = 40.56 CPU)
Result: PASS

@petdance
Owner

Of all the things I am loathe to touch in ack, pipe detection is at the top of the list.

Perhaps the problem is not one of ack, but of Perl incorrectly detecting -p STDIN?

And, as an aside, what does $^O tell us?

@petdance
Owner

I think further discussion of this needs to be on the ack-users mailing list.

@stevenh

$^O gives interix

The following two tests could be used to determine if this works on a platform:
perl -e 'my $p = -p STDIN; my $t = -t STDIN; print "PIPE: $p, TERM: $t\n";'

echo 1 | perl -e 'my $p = -p STDIN; my $t = -t STDIN; print "PIPE: $p, TERM: $t\n";'

If PIPE is 1 when TERM is blank and vice versa all should be good. This is backed up by the fact you $output_to_pipe test on STDOUT uses if "not -t" instead of "-p" is it not?

I've tested the above here on linux, freebsd and interix and it works on all.

@hoelzro
Collaborator

I believe this has been fixed as of ack 2.

@hoelzro hoelzro closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.