Permalink
Browse files

The testsuite should check for eval errors. ("do EXPR" is evil.)

This makes compilation errors much more visible.
  • Loading branch information...
Infinoid committed Nov 13, 2009
1 parent 2a52156 commit b311d9fd2cd32176cced0f02a39580030d115965
Showing with 4 additions and 1 deletion.
  1. +4 −1 t/util.pm
View
@@ -7,7 +7,10 @@ my $module;
my $inst;
sub load_plugin :Export(:DEFAULT) {
$module = shift;
- do "modules/local/$module.pm";
+ my $rv = do "modules/local/$module.pm";
+ return warn "Couldn't parse $module: $@\n" if $@;
+ return warn "Couldn't do $module: $!\n" unless defined $rv;
+ return warn "$module did not return a true value.\n" unless $rv;
$module = "modules::local::$module";
$inst = $module;
call_func('init');

0 comments on commit b311d9f

Please sign in to comment.