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' ); [...]
In reply to Re: Testing for non-perl system requirements
by doom
in thread Testing for non-perl system requirements
by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |