dagolden / Capture-Tiny

(Perl) Capture STDOUT and STDERR from Perl, XS or external programs
http://search.cpan.org/dist/Capture-Tiny/
39 stars 19 forks source link

Tests fail under Cygwin Perl 5.14.2 #27

Open vadz opened 9 years ago

vadz commented 9 years ago

I had tried installing this with cpanm first (as a dependency of something else...) which failed with several errors in the build.log:

...
#   Failed test 'tee_merged|perl|both|multiline - tee STDOUT (STDOUT)'
#   at t/lib/Cases.pm line 240.
#                   'STDERR:First line
# Second line
# '
#     doesn't match '(?^:STDOUT\:First\ line\
# Second\ line\
# )'
# Looks like you failed 1 test of 872.
t/07-stderr-closed.t ....... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/872 subtests 

#   Failed test 'tee_merged|perl|both|multiline - tee STDOUT (STDOUT)'
#   at t/lib/Cases.pm line 240.
#                   'STDERR:First line
# Second line
# '
#     doesn't match '(?^:STDOUT\:First\ line\
# Second\ line\
# )'
# Looks like you failed 1 test of 872.
t/08-stdin-closed.t ........ 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/872 subtests 
t/09-preserve-exit-code.t .. ok
t/10-stdout-string.t ....... ok
t/11-stderr-string.t ....... ok
t/12-stdin-string.t ........ ok

#   Failed test 'tee_merged|perl|both|short - tee STDOUT (STDERR)'
#   at t/lib/Cases.pm line 241.
#                   'STDOUT:Hello World'
#     doesn't match '(?^:STDERR\:Hello\ World)'
# Looks like you failed 1 test of 873.
t/13-stdout-tied.t ......... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/873 subtests 
t/14-stderr-tied.t ......... ok
t/15-stdin-tied.t .......... ok
t/16-catch-errors.t ........ ok
t/17-pass-results.t ........ ok
t/18-custom-capture.t ...... ok
t/19-inline-c.t ............ skipped: Inline::C module required

#   Failed test 'tee_merged|perl|both|multiline - tee STDOUT (STDERR)'
#   at t/lib/Cases.pm line 241.
#                   'STDOUT:First line
# Second line
# '
#     doesn't match '(?^:STDERR\:First\ line\
# Second\ line\
# )'
# Looks like you failed 1 test of 583.
t/20-stdout-badtie.t ....... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/583 subtests 
t/21-stderr-badtie.t ....... ok
t/22-stdin-badtie.t ........ ok
t/23-all-tied.t ............ ok
t/24-all-badtied.t ......... ok

Test Summary Report
-------------------
t/07-stderr-closed.t     (Wstat: 256 Tests: 872 Failed: 1)
  Failed test:  759
  Non-zero exit status: 1
t/08-stdin-closed.t      (Wstat: 256 Tests: 872 Failed: 1)
  Failed test:  759
  Non-zero exit status: 1
t/13-stdout-tied.t       (Wstat: 256 Tests: 873 Failed: 1)
  Failed test:  755
  Non-zero exit status: 1
t/20-stdout-badtie.t     (Wstat: 256 Tests: 583 Failed: 1)
  Failed test:  510
  Non-zero exit status: 1
Files=23, Tests=11996, 144 wallclock secs ( 0.02 usr  0.03 sys + 50.93 cusr 92.69 csys = 143.67 CPU)
Result: FAIL
Failed 4/23 test programs. 4/11996 subtests failed.
Makefile:861: recipe for target `test_dynamic' failed
make: *** [test_dynamic] Error 255

I then retried with plain cpan as I hoped to submit a report about the failure using CPAN::Reporter but this didn't work neither (see https://github.com/cpan-testers/CPAN-Reporter/issues/3), however cpan output was actually different, with only a single error:

...
#   Failed test 'tee_merged|perl|both|short - tee STDOUT (STDERR)'
#   at t/lib/Cases.pm line 241.
#                   'STDOUT:Hello World'
#     doesn't match '(?^:STDERR\:Hello\ World)'
# Looks like you failed 1 test of 873.
t/10-stdout-string.t .......
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/873 subtests
t/11-stderr-string.t ....... ok
t/12-stdin-string.t ........ ok
t/13-stdout-tied.t ......... ok
t/14-stderr-tied.t ......... ok
t/15-stdin-tied.t .......... ok
t/16-catch-errors.t ........ ok
t/17-pass-results.t ........ ok
t/18-custom-capture.t ...... ok
t/19-inline-c.t ............ skipped: Inline::C module required
t/20-stdout-badtie.t ....... ok
t/21-stderr-badtie.t ....... ok
t/22-stdin-badtie.t ........ ok
t/23-all-tied.t ............ ok
t/24-all-badtied.t ......... ok

Test Summary Report
-------------------
t/10-stdout-string.t     (Wstat: 256 Tests: 873 Failed: 1)
  Failed test:  756
  Non-zero exit status: 1
Files=23, Tests=11996, 146 wallclock secs ( 0.00 usr  0.02 sys + 47.47 cusr 94.92 csys = 142.41 CPU)
Result: FAIL
Failed 1/23 test programs. 1/11996 subtests failed.
Makefile:861: recipe for target `test_dynamic' failed
make: *** [test_dynamic] Error 255

I don't know why do the failures differ between cpanm and cpan but at least this is consistent, i.e. I reran each of them a couple of times and the results are always the same.

ghost commented 9 years ago

Hi, i also observed this with cygwin perl 5.10.1 (and version 0.30 of Capture::Tiny):

#   Failed test 'tee_merged|perl|both|multiline - tee STDOUT (STDOUT)'
#   at t/lib/Cases.pm line 240.
#                   'STDERR:First line
# Second line
# '
#     doesn't match '(?-xism:STDOUT\:First\ line\
# Second\ line\
# )'
t/24-all-badtied.t ......... 574/? # Looks like you failed 1 test of 587.
t/24-all-badtied.t ......... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/587 subtests

Test Summary Report
-------------------
t/24-all-badtied.t       (Wstat: 256 Tests: 587 Failed: 1)
xdg commented 8 years ago

Sorry for late followup. Please post your perl -V output.

xdg commented 8 years ago

Possibly related: CPAN testers failures on cygwin-wow architecture. C.f https://gist.github.com/xdg/21279d83c228e48aab2b

ghost commented 8 years ago

`Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

Platform: osname=cygwin, osvers=1.7.0(0.21853), archname=i686-cygwin-thread-multi-64int uname='cygwin_nt-5.1 reini 1.7.0(0.21853) 2009-12-04 17:08 i686 cygwin ' config_args='-de -Dlibperl=cygperl5_10.dll -Dmksymlinks -Dusethreads -Doptimize=-O3' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=undef, uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -USTRICT_ANSI__ -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include', optimize='-O3', cppflags='-DPERL_USE_SAFE_PUTENV -USTRICT_ANSI__ -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.3.4 20090804 (release) 1', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='g++', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib /lib libs=-lgdbm -ldb -ldl -lcrypt -lgdbm_compat perllibs=-ldl -lcrypt libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=cygperl5_10.dll gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY MYMALLOC PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_USE_SAFE_PUTENV USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Locally applied patches: CYG11 no-bs CYG12 no archlib in otherlibdirs CYG14 Dynaloader CYG15 static-Win32CORE CYG17 utf8-paths CYG21 LibList-Kid.patch CYG22 cygwin-1.7 hints CYG23 544-stat CYG24 build man pages CYG26 Cwd for svk Bug#55162 File::Spec::case_tolerant performance disable ExtUtils::MakeMaker::Coverage in Sys-Syslog Built under cygwin Compiled at Dec 18 2009 14:54:24 %ENV: CYGWIN="nodosfilewarning" @INC: /usr/lib/perl5/5.10/i686-cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/i686-cygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/i686-cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 . `

vadz commented 8 years ago

Sorry, I can't provide information about this any more because I am now at Perl 5.22 and this bug doesn't happen with it.

genio commented 6 years ago

Cygwin errors for me with an AppVeyor test:

t/03-tee.t ................. ok
#   Failed test 'tee_merged|perl|both|unicode - tee STDOUT (STDOUT)'
#   at t/lib/Cases.pm line 245.
#                   'STDERR:Hi! ☺
# '
#     doesn't match '(?^u:STDOUT\:Hi\!\ \☺\
# )'
# Looks like you failed 1 test of 872.
t/06-stdout-closed.t ....... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/872 subtests 
t/07-stderr-closed.t ....... ok

Here's the perl -V

perl -V
Summary of my perl5 (revision 5 version 26 subversion 2) configuration:

  Platform:
    osname=cygwin
    osvers=2.10.0(0.32553)
    archname=i686-cygwin-threads-64int-multi
    uname='cygwin_nt-6.3-wow cygwin 2.10.0(0.32553) 2018-02-02 15:21 i686 cygwin '
    config_args='-des -Dprefix=/usr -Dmksymlinks -Darchname=i686-cygwin-threads-64int -Dlibperl=cygperl5_26.dll -Dcc=gcc -Dld=g++ -Accflags=-ggdb -O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mnt/share/maint/perl.x86/build=/usr/src/debug/perl-5.26.2-1 -fdebug-prefix-map=/mnt/share/maint/perl.x86/src/perl-5.26.2=/usr/src/debug/perl-5.26.2-1 -fwrapv'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='gcc'
    ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -ggdb -O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mnt/share/maint/perl.x86/build=/usr/src/debug/perl-5.26.2-1 -fdebug-prefix-map=/mnt/share/maint/perl.x86/src/perl-5.26.2=/usr/src/debug/perl-5.26.2-1 -fwrapv -fno-strict-aliasing'
    optimize='-O3'
    cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -ggdb -O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mnt/share/maint/perl.x86/build=/usr/src/debug/perl-5.26.2-1 -fdebug-prefix-map=/mnt/share/maint/perl.x86/src/perl-5.26.2=/usr/src/debug/perl-5.26.2-1 -fwrapv -fno-strict-aliasing'
    ccversion=''
    gccversion='6.4.0'
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=4
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=12
    longdblkind=3
    ivtype='long long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='g++'
    ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong'
    libpth=/usr/lib
    libs=-lpthread -lgdbm -ldb -ldl -lcrypt -lgdbm_compat
    perllibs=-lpthread -ldl -lcrypt
    libc=/usr/lib/libcygwin.a
    so=dll
    useshrplib=true
    libperl=cygperl5_26.dll
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=dll
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags=' --shared  -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong'
Characteristics of this binary (from libperl): 
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_IMPLICIT_CONTEXT
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_SAFE_PUTENV
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
  Locally applied patches:
    Cygwin: README
    Cygwin: use auto-image-base instead of fixed DLL base address
    Cygwin: modify hints
    Cygwin: Configure correct libsearch
    Cygwin: Configure correct libpth
    Cygwin: Win32 correct UTF8 handling
    Perl: File-Path-2.14 (fixes CVE2017-6512)
  Built under cygwin
  Compiled at Apr 16 2018 21:22:09
  @INC:
    /usr/local/lib/perl5/site_perl/5.26/i686-cygwin-threads-64int
    /usr/local/share/perl5/site_perl/5.26
    /usr/lib/perl5/vendor_perl/5.26/i686-cygwin-threads-64int
    /usr/share/perl5/vendor_perl/5.26
    /usr/lib/perl5/5.26/i686-cygwin-threads-64int
    /usr/share/perl5/5.26