1 t/00load.t: Adjust for ptest
3 Change load test to look for installed location in @INC as base for
4 modules instead of locally in 'lib' directory as when run inside the
7 Upstream-Status: Inappropriate [OE ptest specific]
9 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
11 t/00load.t | 16 ++++++++++++----
12 1 file changed, 12 insertions(+), 4 deletions(-)
14 diff --git a/t/00load.t b/t/00load.t
15 index abc8c58..88a5545 100644
18 @@ -5,21 +5,29 @@ use strict;
19 use warnings FATAL => 'all';
21 use Test::More tests => 22;
25 -my $dir = path('lib/');
28 + if (-d "$_/XML/XPath") {
29 + $installdir = "$_/XML/XPath";
33 +my $dir = path($installdir);
34 my $iter = $dir->iterator({
39 +BAIL_OUT( "XML::XPath does not compile" ) unless require_ok("XML::XPath");
41 while (my $path = $iter->()) {
42 next if $path->is_dir || $path !~ /\.pm$/;
43 my $module = $path->relative;
44 - $module =~ s/(?:^lib\/|\.pm$)//g;
45 + $module =~ s/(?:^.*XML\/|\.pm$)//g;
47 - BAIL_OUT( "$module does not compile" ) unless require_ok($module);
48 + BAIL_OUT( "$module does not compile" ) unless require_ok("XML::$module");
51 diag( "Testing XML::XPath $XML::XPath::VERSION, Perl $], $^X" );