From c189c6967b2d6cb62a4276cc3a70cd74ed9bbd37 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 9 Sep 2009 09:52:34 -0700 Subject: [PATCH] Read preload.custom for extra lib paths in tests. --- t/lib/WebGUI/Test.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/t/lib/WebGUI/Test.pm b/t/lib/WebGUI/Test.pm index 9c757d92d..bdb10bcdf 100644 --- a/t/lib/WebGUI/Test.pm +++ b/t/lib/WebGUI/Test.pm @@ -126,6 +126,24 @@ BEGIN { push (@INC,$WEBGUI_LIB); + ##Handle custom loaded library paths + warn $WEBGUI_ROOT; + my $customPreload = File::Spec->catdir( $WEBGUI_ROOT, 'sbin', 'preload.custom'); + warn $customPreload; + if (-e $customPreload) { + open my $PRELOAD, '<', $customPreload or + croak "Unload to open $customPreload: $!\n"; + LINE: while (my $line = <$PRELOAD>) { + $line =~ s/#.*//; + $line =~ s/^\s+//; + $line =~ s/\s+$//; + next LINE if !$line; + warn $line; + push @INC, $line; + } + close $PRELOAD; + } + # http://thread.gmane.org/gmane.comp.apache.apreq/3378 # http://article.gmane.org/gmane.comp.apache.apreq/3388 if ( $^O eq 'darwin' && $Config::Config{osvers} lt '8.0.0' ) {