in reply to Testing for non-perl system requirements
All I can do is throw an exception and exit if something is missing, or notify and continue.
What I would do is have the test code check to see if something is missing and then use Test::More's "skip" feature to skip any tests that depend on the feature.
I realize this isn't what you regard as The Right Way, but I think it works tolerably well. I think it would be pretty difficult for the build process to cover every sort of system feature that you might be interested in checking.
(I see that if I have to skip all of the tests, the smoketest machines mail me UNKNOWN messages instead of FAIL... seems reasonable, off hand).
If anyone's interested, I've been writing test code that looks like:
use Test::More; my $emacs_found = qx{ emacs --version 2>/dev/null }; if( not( $emacs_found ) ) { plan skip_all => 'emacs was not found in PATH'; } else { plan tests => 27; } use_ok( 'Emacs::Run' ); [...]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Testing for non-perl system requirements
by leocharre (Priest) on Apr 03, 2008 at 17:12 UTC | |
by doom (Deacon) on Apr 03, 2008 at 22:13 UTC | |
by Intrepid (Curate) on Apr 08, 2008 at 15:55 UTC | |
by mr_mischief (Monsignor) on Apr 08, 2008 at 04:59 UTC |