Hi again Monks,
So I finally got around to troubleshooting one of my module CPAN Testers failures on Windows platforms.
It became clear after a while that the purpose for the failures is that I have sample data files, along with base expected output files for certain tests in my suite. These are breaking because of line endings. I've worked around it in my Makefile.PL file with the following, and I'm just wondering if this is overkill and whether there's a more sane way to make my tests cross-platform. Note that I'm just sweeping the entire /t directory as a test. I'll make the work focus only on the necessary files if there isn't a better way.
if ($^O eq 'MSWin32'){ print "\nPreparing unit tests for MSWin32 platform...\n\n"; my $dir = getcwd(); $dir .= "/t"; my @files; find({wanted => sub { return if ! -f; my $file = $File::Find::name; push @files, $file; }, no_chdir => 1, }, $dir, ); for (@files){ tie my @file, 'Tie::File', $_ or die $!; for (@file){ s/\n/\r\n/g; } untie @file; } }
Cheers,
-stevieb
In reply to CPAN module unit test issues: OS line endings by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |