Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Building Win32::GuiTest for perl 5.14 or higher (Bad tests!)

by cavac (Parson)
on Jun 25, 2012 at 20:22 UTC ( [id://978263]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Building Win32::GuiTest for perl 5.14 or higher (Bad tests!)
in thread Building Win32::GuiTest for perl 5.14 or higher

The author should bail out (or possibly die at Makefile.PL stage) if Win32/cygwin isn't available.

Yes. And no. I myself have a few Windows- or Linux-only modules in my DarkPan repo. Mostly, they come in pairs (same external API, but completly different internals). Instead of failing to build on the "wrong" OS, they build as "hollow shells" without functionality (except to die() when new() is called.

Doing it this way makes coding project that depend on a huge number of modules easier. You just pull in all your prerequisites (no fiddling around with Makefile.PL) and you can even use them (no more fiddling around with require and eval and stuff). In the main project, i then just have to decide with ones are the ones i instanciate.

Of course, that's my own special bikeshed color. Yours might vary ;-)

"You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."
  • Comment on Re^4: Building Win32::GuiTest for perl 5.14 or higher (Bad tests!)
  • Download Code

Replies are listed 'Best First'.
Re^5: Building Win32::GuiTest for perl 5.14 or higher (Bad tests!)
by davido (Cardinal) on Jun 25, 2012 at 21:01 UTC

    Wouldn't it be better to configure the test suite with TODO's, and the incomplete target code with "..." operators instead of polluting the code base with silently-incomplete code?

    I do understand your point though. But it's probably more applicable to the development process than it is to a module uploaded for the world to use on CPAN.


    Dave

      I can agree to that. It really depends if it's mostly an internal process streamlined for fast development (often enough i only have hours to days to come up with a large one-off solution that's running for a limited time and scope). Or if the module is designed for a broad audience.

      What it comes down to, in my mind at least, is that many of those problems could be avoided by an enhanced, clearer syntax for conditionally specifying modules as optional requirements ("i need that or that, but at least one of them") as well as clearer syntax for conditionaly using them in the scripts (best solution would be "try this list of modules in the given order and load the first one you find and tell me which one it was").

      Example: Let's say we have two modules with the same API, but one for Linux/Unix and one for windows, i could them do

      my $pwmodule = use_first qw[Linux::Power Win32::Power]; my $power = $pwmodule::new(); $power->suspend();

      "You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-25 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found