paixaop has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I just released my first module on CPAN and some of the tests on CPAN Testers are failing. I want to fix those errors on all the other platforms, so the module can be totaly platform independent, and have all tests pass.

Since I do not have a way of installing all those distros and perl versions, what is your best advice to troubleshoot and debug what is going on?

How do you do it?

Thank you in advance for your wisdom

  • Comment on CPAN Testing in multiple platforms how to Debug?

Replies are listed 'Best First'.
Re: CPAN Testing in multiple platforms how to Debug?
by toolic (Bishop) on Jun 15, 2010 at 01:52 UTC
    The Monks could probably provide more specific help if you showed one of the error reports. Without that, the first thing that comes to mind is perlport.

    I looked at your home node and deduced that WWW::Salesforce::Report is the module in question. Perhaps this link will make it more convenient for Monks to look at a few of your failing reports.

Re: CPAN Testing in multiple platforms how to Debug?
by bluescreen (Friar) on Jun 15, 2010 at 01:57 UTC

    The only way anybody can help you is if you post the code that is failing, both tests and module's code. It would be ideal if you can trim down your code to the failing portion of it.

    From that you would get much more advice and directions to make your code platform independent

    Does it uses any external libraries like libsomething.so? Does it has any .xs? Is it checking the version of its dependencies? What platforms your code is failing in? Is your module assuming folder separator is "/"? Does it has system calls?

    Point is without the code all we can do is guess...

      Thanks for your advice. My initial question was more of a generic nature, of how to easily run tests in several platforms. But narrowing it down to my current problem here is the code in question
      eval { $sfr = WWW::Salesforce::Report->new( file => "t/report.csv", ); $data = $sfr->get_report(); };
      the part that fails in the get_report sub is as follows:
      sub get_report () { ... open my $fh,"<", $self->{ file } or croak "Could not open $self->{ file } : $!"; $res = ""; while( <$fh> ) { $res .= $_; } ... }
      report.csv is a file that exists in the test directory or "WWW-Salesforce-Report-0.01/t"

      $self->{ file } is assigned in new to the file name passed in "file"

        Forgot to add the report.csv file:
        "Opportunity Owner","Opportunity Owner Email","Opportunity Name","Amou +nt" "John Doe","john@domain.com","Big Opp","492203.79" "Jane Doe","jane@domain.com","Huge Opp","210456.20"
        File created on a MAC. Will this have problems with the new lines in other platforms?