Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: CPAN Smoke Tests: Some platforms are meant to be broken

by Corion (Pope)
on Aug 21, 2011 at 20:30 UTC ( #921551=note: print w/replies, xml ) Need Help??


in reply to CPAN Smoke Tests: Some platforms are meant to be broken

I think if your tests are inapplicable, the best approach is to bail out from Makefile.PL with an exit code of 1 and the message "BAIL OUT!" (or something like that) on STDERR. Maybe it's also enough to just not create a Makefile. Have a look around at other modules that are OS-specific. For Win32::Wlan, I use the following boilerplate code in the tests skip all the tests unless they are applicable:

#perl -w use strict; use Test::More; BEGIN { if ($^O !~ /Win32/i) { plan skip_all => "Win32::Wlan only works on Win32"; } else { plan tests => 1; } }; ...

Replies are listed 'Best First'.
Re^2: CPAN Smoke Tests: Some platforms are meant to be broken
by saintmike (Vicar) on Aug 21, 2011 at 20:40 UTC
    ... but according to the smoke test reports, there's green light for GNU/Linux, OpenBSD, NetBSD, and Solaris :).

    Wouldn't you rather have a clear indication that it doesn't work on these platforms?

      I think there is some way of telling CPAN testers to emit n/a for those operating systems, but if somebody installs a module with Win32:: in its name on a system that is not Win32 (or Win64), I don't think that passing tests are their main problem :)

        I think there is some way of telling CPAN testers to emit n/a for those operating systems

        I think it's just a matter of beginning the Makefile.PL code with something like:
        exit 0 if $^O=~/MSWin/;
        That should put an NA into the matrix for any module being built on Windows - no report gets sent to the author.

        But I think the exit value is important, so it would be best to verify (eg on the cpan-testers mailing list) that 0 is, in fact, the correct value to specify.

        Cheers,
        Rob
        From the CPANTS FAQ for authors:

        "How can I indicate that my distribution only works on a particular operating system?"

        While it isn't a very elegant solution, the recommend approach is to either die in the Makefile.PL or Build.PL (or BAIL_OUT in a test file) with one of the following messages:

        • No support for OS
        • OS unsupported

        CPAN Testers tools will look for one of those phrases and will send an NA (Not Available) report for that platform.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://921551]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2020-07-14 17:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?