Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests failed if File::Temp is too old (Perl 5.8.8 on CentOS5) #29

Closed
cheese opened this issue Aug 23, 2016 · 4 comments
Closed

Tests failed if File::Temp is too old (Perl 5.8.8 on CentOS5) #29

cheese opened this issue Aug 23, 2016 · 4 comments

Comments

@cheese
Copy link

cheese commented Aug 23, 2016

It is manifested that the package supports as old as 5.6.1. But on CentOS5, with Perl 5.8.8, some tests will fail. File::temp may be too old to have some new function like 'newdir'.

+ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.........# Testing File::Next 1.16, Perl 5.008008, /usr/bin/perl
ok
t/api.............ok
t/basic...........ok
t/dirs............ok
t/dot.............ok
t/everything......ok
t/follow..........# t/follow.t is working with temp directory /tmp/cR5getxc30
ok
t/from_file.......Operation "eq": no method found,
    left argument has no overloaded magic,
    right argument in overloaded package File::Temp at /usr/lib/perl5/5.8.8/File/Copy.pm line 76.
# Looks like you planned 17 tests but only ran 10.
# Looks like your test died just after 10.
dubious
    Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 11-17
    Failed 7/17 tests, 58.82% okay
t/from_stdin......ok
t/methods.........ok
t/named-pipe......Can't locate object method "newdir" via package "File::Temp" at t/named-pipe.t line 15.
# Looks like your test died before it could output anything.
dubious
    Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-2
    Failed 2/2 tests, 0.00% okay
t/parms...........ok
t/pod-coverage....ok
t/pod.............ok
t/sort............ok
t/zero............ok
Failed Test    Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/from_file.t   255 65280    17   14  82.35%  11-17
t/named-pipe.t  255 65280     2    4 200.00%  1-2
Failed 2/16 test scripts, 87.50% okay. 9/89 subtests failed, 89.89% okay.
@petdance petdance added the Linux label Nov 4, 2016
@petdance petdance added the Bug label Dec 10, 2016
@anti-fun
Copy link

As the opener suspected it looks like both issues stem from using File::Temp objects, which were not fully formed in older versions of Perl. File::Temp didn't have a newdir method until 5.10.1 and File::Copy::copy doesn't seem to like a File::Temp object as an argument until 5.8.9. An easy fix would be to switch to the functions File::Temp::tempfile() and File::Temp::tempdir() in those tests instead of using objects.

I'd be happy to take this on if that sounds like a good solution.

@petdance
Copy link
Owner

$ corelist -v 5.8.8 File::Temp
File::Temp 0.16
$ corelist -v 5.10.1 File::Temp
File::Temp 0.22

It would be less code changing if we specified that we have to have File::Temp 0.22. Do you see any reason that wouldn't work?

@anti-fun
Copy link

Looks like it would work. I'm able to get the tests to pass on 5.6.1 with File::Temp v0.22 installed

@petdance
Copy link
Owner

Change made. Thanks! 50c6ea3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants