From 5968acc1e388949bde1d5fabd6151bfe87f8c0fb Mon Sep 17 00:00:00 2001 From: Mirko Tietgen Date: Fri, 8 Dec 2017 12:34:59 +0100 Subject: [PATCH] Bug 19783 - make check_kohastructure.t compatible to package build process Check if kohastructure.pl is found in the package build location and runs the test if found. Otherwise runs as before. --- t/check_kohastructure.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/t/check_kohastructure.t b/t/check_kohastructure.t index ec5c48c..6bee424 100644 --- a/t/check_kohastructure.t +++ b/t/check_kohastructure.t @@ -19,8 +19,16 @@ use Modern::Perl; use Test::More tests => 1; use File::Slurp; use C4::Context; -my $content = read_file( C4::Context->config("intranetdir") + +my $content; +if ( -e 'blib/INTRANET_CGI_DIR/installer/data/mysql/kohastructure.sql' ) { + #debian package build process + $content = read_file('blib/INTRANET_CGI_DIR/installer/data/mysql/kohastructure.sql'); +} +else { + $content = read_file( C4::Context->config("intranetdir") . '/installer/data/mysql/kohastructure.sql' ); +} my @drop_stmt_missing; my $ccc = $content; while ( $content =~ m|CREATE TABLE `?([^`\n ]*)`?\s?\(\s*\n|g ) { -- 2.1.4