From: Peter Rabbitson Date: Wed, 4 Nov 2015 14:48:23 +0000 (+0100) Subject: Fail more gracefully on non-loadable compiled module parts X-Git-Tag: v0.11022~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FSQL-Translator.git;a=commitdiff_plain;h=ac8d330a378aa569a21c2952ffa784afbbab18dc Fail more gracefully on non-loadable compiled module parts Without this in my current system state `prove -l t/09sqlt-diagram.t` gives ...Can't load producer 'Diagram' : Error loading Diagram as SQL::Translator::Producer::Diagram : Can't load '.../5.16.2/lib/site_perl/5.16.2/x86_64-linux-thread-multi-ld/auto/GD/GD.so' for module GD: libgd.so.2: cannot open shared object file: No such file or directory at .../5.16.2/lib/5.16.2/x86_64-linux-thread-multi-ld/DynaLoader.pm line 190. --- diff --git a/lib/Test/SQL/Translator.pm b/lib/Test/SQL/Translator.pm index 0b2ade7..5803536 100644 --- a/lib/Test/SQL/Translator.pm +++ b/lib/Test/SQL/Translator.pm @@ -459,6 +459,9 @@ sub maybe_plan { elsif ($@ =~ /([\w\:]+ version [\d\.]+) required.+?this is only version/) { push @errors, $1; } + elsif ($@ =~ /Can't load .+? for module .+?DynaLoader\.pm/i ) { + push @errors, $module; + } } if (@errors) { diff --git a/t/09sqlt-diagram.t b/t/09sqlt-diagram.t index 85d5598..0c6930b 100644 --- a/t/09sqlt-diagram.t +++ b/t/09sqlt-diagram.t @@ -11,9 +11,10 @@ use Text::ParseWords qw(shellwords); BEGIN { maybe_plan( 3, - 'SQL::Translator::Parser::MySQL', - 'SQL::Translator::Producer::Diagram', + 'GD', 'Graph::Directed', + 'SQL::Translator::Producer::Diagram', + 'SQL::Translator::Parser::MySQL', ); }