Re: How to best have statements execute only during dev/testing?
--- A. Pagaltzis wrote: Additive filters that the same code can run without are sane when used carefully, and they're easy to create if the trigger is a special comment or better yet POD section: Damian's Smart::Comments module filters specially formatted comments and can do assertions and quite a lot more. From its doco: This module is probably even relatively safe with other Filter::Simple modules since it is very specific and limited in what it filters Also, as noted at: http://www.oreillynet.com/pub/wlg/8894 Perl 5.10 will have assertions. /-\ Do you Yahoo!? Check out gigs in your area on the comprehensive Yahoo! Music Gig Guide http://au.music.yahoo.com/gig-guide
Re: How to best have statements execute only during dev/testing?
On Jan 11, 2006, at 4:15 AM, Andrew Savige wrote: Damian's Smart::Comments module filters specially formatted comments and can do assertions and quite a lot more. I especially like the idea of filtered comments - rather elegant solution. Also, we've given some thought to the issue of whether we really want to turn off our assertion statements in production and have decided that: 1. We should probably leave them in. 2. The ability to turn them off is a lower value feature so even if we add it, it'll be in a later iteration. 3. This thread has been very informative about practical techniques, so we will have a couple good ideas to choose from rather than invent our own. --- Matisse Enzer [EMAIL PROTECTED] http://www.matisse.net/ - http://www.eigenstate.net/
how to detect that we're running under CPAN::Testers?
Hello, Is there any way to tell if my package is being tested automatically under CPAN::Testers? Here's the situation: I have a DBI extension (DBIx::Transaction) whose unit tests currently depend on a valid DSN being available. SQLite makes a good testbed for mock databases, so if DBD::SQLite2 is available, my module defaults to testing against a temporary database using that. Thus, DBIx-Transaction-0.04 depends on DBD::SQLite2 *unless* the DBI_DSN environment variable is set to a non-SQLite2 driver. If DBI_DSN is set to an empty string, the tests do not run at all. Some people think that in a perfect world, end users should not be made to install DBD::SQLite2 by default. I'm leaning towards that as well; less bloat is good. However, when these packages are being auto-tested as part of the perl QA effort (and possibly for packaging for use in ActivePerl on ppm.activestate.com as well), I'd like my Makefile.PL to notice this and depend on DBD::SQLite2 after all, so that the tests will be run and we have an assurance that the package works. Any thoughts/ideas? Thanks, Tyler
Re: how to detect that we're running under CPAN::Testers?
Tyler MacDonald wrote: Hello, Is there any way to tell if my package is being tested automatically under CPAN::Testers? For CPAN smokers based on CPAN::YACSmoke, the answer is: test the presence of the AUTOMATED_TESTING environment variable. See also the following page for more details: http://search.cpan.org/dist/CPAN-YACSmoke/lib/CPAN/YACSmoke/FAQ.pod -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Re: how to detect that we're running under CPAN::Testers?
Sébastien Aperghis-Tramoni [EMAIL PROTECTED] wrote: For CPAN smokers based on CPAN::YACSmoke, the answer is: test the presence of the AUTOMATED_TESTING environment variable. See also the following page for more details: http://search.cpan.org/dist/CPAN-YACSmoke/lib/CPAN/YACSmoke/FAQ.pod Awesome, that's what I was after. :) Are there any other automated testing environments that post their results to testers.cpan.org I should worry about? Thanks, Tyler
Re: how to detect that we're running under CPAN::Testers?
Tyler MacDonald wrote: Sébastien Aperghis-Tramoni [EMAIL PROTECTED] wrote: For CPAN smokers based on CPAN::YACSmoke, the answer is: test the presence of the AUTOMATED_TESTING environment variable. See also the following page for more details: http://search.cpan.org/dist/CPAN-YACSmoke/lib/CPAN/YACSmoke/FAQ.pod Awesome, that's what I was after. :) Are there any other automated testing environments that post their results to testers.cpan.org I should worry about? AFAICT, serious smokers (the ones that automatically and regularly send CPAN Testers reports) all use CPAN::YACSmoke. The previously used one was cpansmoke, included with previous versions of CPANPLUS: http://search.cpan.org/dist/CPANPLUS-0.0499/bin/cpansmoke I don't think it provided a hint for telling a module whether it was automated testing or not, but I don't think that anybody still use it. That's something not indicated in the CPAN Testers Statistics site, which was finally made available (but very silently) by Barbie: http://perl.grango.org/ Other reports may be send by people like me when they interactively install modules using CPANPLUS, or by hand using Test::Reporter. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.