[Koha-patches] [PATCH] testing framework: replacing PERL5LIB in order to more conidently find libraries

Andrew Moore andrew.moore at liblime.com
Tue Apr 22 15:41:49 CEST 2008


This patch makes the test suite work even when $PERL5LIB isn't set to the install directory.
It replaces $PERL5LIB with '..' in order to help ensure that we're loading the C4 libraries
out of the installation directory.
---
 t/Makefile              |    3 ++-
 t/database_dependent.pl |    2 --
 t/lib/KohaTest.pm       |    1 -
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/t/Makefile b/t/Makefile
index a41907e..226b554 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -14,6 +14,7 @@ PERL = /usr/bin/perl
 TEST_FILES = database_dependent.pl
 PROVE = /usr/bin/prove
 PROVE_FLAGS = -v
+PERL5LIB = ..
 KOHA_CONF_DIR = ../etc
 CONF_FILE_TEMPLATE = $(KOHA_CONF_DIR)/koha-conf.xml 
 TEST_CONF_FILE = run/etc/koha-conf.xml
@@ -56,7 +57,7 @@ $(SCRIPTS) ::
 	$(CHMOD) 755 $(TEST_SCRIPT_DIR)/$@
 
 test :: config_file $(ZEBRA_CONF_FILES) $(SCRIPTS)
-	KOHA_CONF=$(TEST_CONF_FILE) $(PROVE) $(PROVE_FLAGS) $(TEST_FILES)
+	KOHA_CONF=$(TEST_CONF_FILE) PERL5LIB=$(PERL5LIB) $(PROVE) $(PROVE_FLAGS) $(TEST_FILES)
 
 test_run_dirs ::
 	$(MKPATH) run/etc
diff --git a/t/database_dependent.pl b/t/database_dependent.pl
index 3afd422..6844a6d 100644
--- a/t/database_dependent.pl
+++ b/t/database_dependent.pl
@@ -15,8 +15,6 @@ use C4::Languages;
 use Data::Dumper;
 use Test::More;
 
-use lib q( . .. );
-
 use Test::Class::Load qw ( . ); # run from the t directory
 
 create_test_database();
diff --git a/t/lib/KohaTest.pm b/t/lib/KohaTest.pm
index da57f47..9286306 100644
--- a/t/lib/KohaTest.pm
+++ b/t/lib/KohaTest.pm
@@ -8,7 +8,6 @@ eval "use Test::Class";
 plan skip_all => "Test::Class required for performing database tests" if $@;
 # Or, maybe I should just die there.
 
-use lib qw(..);
 use C4::Biblio;
 use C4::Bookfund;
 use C4::Bookseller;
-- 
1.5.2.1




More information about the Koha-patches mailing list