Subject: | MS Windows compatibility fix |
Please consider the following fix that handles a scenario when a user has perl installed on a disk drive other than C:
diff -ru Config-IOD-Reader-0.16/lib/Config/IOD/Base.pm Config-IOD-Reader-0.16_patched/lib/Config/IOD/Base.pm --- Config-IOD-Reader-0.16/lib/Config/IOD/Base.pm 2015-05-05 03:53:33.000000000 +0200 +++ Config-IOD-Reader-0.16_patched/lib/Config/IOD/Base.pm 2015-06-05 12:15:37.176583500 +0200 @@ -362,9 +362,9 @@ # included file's path is based on the main (topmost) file if (@{ $self->{_include_stack} }) { require File::Spec; - my (undef, $dir, $file) = + my ($vol, $dir, $file) = File::Spec->splitpath($self->{_include_stack}[-1]); - $path = File::Spec->rel2abs($path, $dir); + $path = File::Spec->rel2abs($path, File::Spec->catpath($vol, $dir)); }
Without the patch I see the following failure:
Running make test "D:\strawberry32\perl\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t/*.t t/00-compile.t ............ ok t/01-common.t ............. ok t/release-pod-coverage.t .. skipped: these tests are for release candidate testing t/release-pod-syntax.t .... skipped: these tests are for release candidate testing t/release-rinci.t ......... skipped: these tests are for release candidate testing t/spec.t .................. # .IOD files are at C:\Users\kmx\AppData\Local\Temp\aMA6E33G_Q # [ # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/comment.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/dir-include-child.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/dir-include.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/dir-include2.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/dir-merge-self.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/dir-merge.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/dir-merge2.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/dirsyntax.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/empty-section.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/empty.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/encoding-base64.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/encoding-hex.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/encoding-json.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/extra-bench-basic-compat.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/extra-bench-basic.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/extra-bench-typical1.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-dir-args.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-dir-include-nofile.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-dir-include-notfound.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-dir-include-recursive.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-dir-unknown.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-directive-unknown.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-encoding-json.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-encoding-unknown.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-key-emptyname.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-key-noassign.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/invalid-section.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/key.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/multisection.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/multival.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/nested-section.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/nested-section2.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/nosection.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/section.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/simple.iod', # 'C:\\Users\\kmx\\AppData\\Local\\Temp\\aMA6E33G_Q/examples/whitespace.iod' # ] t/spec.t .................. 1/? \Users\kmx\AppData\Local\Temp\aMA6E33G_Q\examples\dir-include-child.iod: No such file or directory at D:\strawberry32\cpan\buil d\Config-IOD-Reader-0.16-cvjJ9p\blib\lib/Config/IOD/Base.pm line 370. # Child (file C:\Users\kmx\AppData\Local\Temp\aMA6E33G_Q/examples/dir-include.iod) exited without calling finalize() # Failed test 'file C:\Users\kmx\AppData\Local\Temp\aMA6E33G_Q/examples/dir-include.iod' # at D:/strawberry32/perl/lib/Test/Builder.pm line 279. # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 2 just after 3. t/spec.t .................. Dubious, test returned 2 (wstat 512, 0x200) Failed 1/3 subtests Test Summary Report ------------------- t/spec.t (Wstat: 512 Tests: 3 Failed: 1) Failed test: 3 Non-zero exit status: 2 Parse errors: No plan found in TAP output Files=6, Tests=22, 3 wallclock secs ( 0.11 usr + 0.02 sys = 0.13 CPU) Result: FAIL