summaryrefslogtreecommitdiffstats
path: root/meta-oem-production-readiness/meta-agl-basesystem/recipes-devtools/perl/libxml-xpath-perl/adjust-load-test-for-ptest.patch
blob: 23e6569dec63edaf06d136c264fb0b95dd2a0427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
t/00load.t: Adjust for ptest

Change load test to look for installed location in @INC as base for
modules instead of locally in 'lib' directory as when run inside the
source tree.

Upstream-Status: Inappropriate [OE ptest specific]

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
 t/00load.t | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/t/00load.t b/t/00load.t
index abc8c58..88a5545 100644
--- a/t/00load.t
+++ b/t/00load.t
@@ -5,21 +5,29 @@ use strict;
 use warnings FATAL => 'all';
 
 use Test::More tests => 22;
-use lib 'lib';
 use Path::Tiny;
 
-my $dir  = path('lib/');
+my $installdir = "";
+foreach (@INC) {
+    if (-d "$_/XML/XPath") {
+	$installdir = "$_/XML/XPath";
+	last;
+    }
+}
+my $dir  = path($installdir);
 my $iter = $dir->iterator({
     recurse         => 1,
     follow_symlinks => 0,
 });
 
+BAIL_OUT( "XML::XPath does not compile" ) unless require_ok("XML::XPath");
+
 while (my $path = $iter->()) {
     next if $path->is_dir || $path !~ /\.pm$/;
     my $module = $path->relative;
-    $module =~ s/(?:^lib\/|\.pm$)//g;
+    $module =~ s/(?:^.*XML\/|\.pm$)//g;
     $module =~ s/\//::/g;
-    BAIL_OUT( "$module does not compile" ) unless require_ok($module);
+    BAIL_OUT( "$module does not compile" ) unless require_ok("XML::$module");
 }
 
 diag( "Testing XML::XPath $XML::XPath::VERSION, Perl $], $^X" );