You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
simply run (d)make test on either cygwin or strawberry perl
Expected behavior
Tests should pass.
Actual behavior
Test failure:
Test Summary Report
-------------------
t/mojo/file.t (Wstat: 512 Tests: 9 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
t/mojo/home.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: No plan found in TAP output
Files=89, Tests=10609, 62 wallclock secs ( 0.84 usr 0.34 sys + 27.80 cusr 23.52 csys = 52.51 CPU)
Result: FAIL
Failed 2/89 test programs. 0/10609 subtests failed.
My analysis
In both cases the failure details are like:
t/mojo/file.t .................... file.t: No such file or directory at /cygdrive/d/git/mojo.git/blib/lib/Mojo/File.pm line 103.
t/mojo/home.t .................... /cygdrive/d/git/mojo.git/does_not_exist: No such file or directory at /cygdrive/d/git/mojo.git/blib/lib/Mojo/File.pm line 103.
After some investigation it turned out that Cwd's function abs_path behaves differently on MSWin32, cygwin and linux. The difference is that on linux you can successfully pass a non-existing file as a param to abs_path like this:
However on MSWin32 (strawberry perl) it dies when the file does not exist:
d:\strawberry> perl -MCwd=abs_path -E "say abs_path('nonexisting.file')"
nonexisting.file: No such file or directory at -e line 1.
and the same on cygwin:
[kmx@cygwin ~]$ perl -MCwd=abs_path -E "say abs_path('nonexisting.file')"
nonexisting.file: No such file or directory at -e line 1.
So perhaps replacing Cwd's abs_path with File::Spec::Functions's rel2abs might be the way to fix this issue. According to rel2abs documentation: No checks against the filesystem are made so it should work fine with non-existing files.
This seems to be the only one issue with v7.15 on cygwin. But there are some more troubles on MSWin32 (mostly related to / vs \ in dir/file paths) - these I have not analysed yet and I think they might be worth a separate issue.
The text was updated successfully, but these errors were encountered:
Keep in mind that (as you noted) rel2abs does not make any checks against the filesystem, so it does not resolve symlinks nor .. or . path components. This may or may not matter for the tests.
Steps to reproduce the behavior
simply run
(d)make test
on either cygwin or strawberry perlExpected behavior
Tests should pass.
Actual behavior
Test failure:
My analysis
In both cases the failure details are like:
After some investigation it turned out that Cwd's function
abs_path
behaves differently on MSWin32, cygwin and linux. The difference is that on linux you can successfully pass a non-existing file as a param toabs_path
like this:However on MSWin32 (strawberry perl) it dies when the file does not exist:
and the same on cygwin:
So perhaps replacing Cwd's
abs_path
with File::Spec::Functions'srel2abs
might be the way to fix this issue. According to rel2abs documentation: No checks against the filesystem are made so it should work fine with non-existing files.This seems to be the only one issue with v7.15 on cygwin. But there are some more troubles on MSWin32 (mostly related to
/
vs\
in dir/file paths) - these I have not analysed yet and I think they might be worth a separate issue.The text was updated successfully, but these errors were encountered: