From 2e692c82d0143c21ab28d7741f07d65083e04271 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Thu, 8 Jan 2009 17:23:53 +0900 Subject: [PATCH] Ensure that perl module tests work before pspp has been installed --- perl-module/Makefile.PL | 2 +- perl-module/t/Pspp.t | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/perl-module/Makefile.PL b/perl-module/Makefile.PL index 77505f2f..20587a62 100644 --- a/perl-module/Makefile.PL +++ b/perl-module/Makefile.PL @@ -13,6 +13,7 @@ do 'pspp-module-config' || do { }; WriteMakefile( + FULLPERL => "PSPP_TEST_CMD=\"$Locations{BuildDir}/src/ui/terminal/pspp -B $Locations{SourceDir}/config\" \$(PERL)", NAME => 'PSPP', DISTNAME => 'PSPP-Perl', VERSION_FROM => "$Locations{BuildDir}/src/libpspp/version.c", @@ -21,7 +22,6 @@ WriteMakefile( (ABSTRACT_FROM => 'lib/PSPP.pm', # retrieve abstract from module AUTHOR => 'John Darrington ') : ()), INC => "-I $Locations{SourceDir} -I $Locations{SourceDir}/src -I $Locations{SourceDir}/gl -I $Locations{BuildDir}/gl -I $Locations{BuildDir}", - MYEXTLIB => "$Locations{BuildDir}/src/.libs/libpspp-core\$(LIB_EXT)", MAN3PODS => {"lib/PSPP.pm", "\$(INST_MAN3DIR)/PSPP.3pm", "Examples.pod", "\$(INST_MAN3DIR)/PSPP::Examples.3pm"} diff --git a/perl-module/t/Pspp.t b/perl-module/t/Pspp.t index 6e8510f8..fe141514 100644 --- a/perl-module/t/Pspp.t +++ b/perl-module/t/Pspp.t @@ -20,6 +20,13 @@ sub compare return ! diff ("$file", \$pattern); } +my $pspp_cmd = $ENV{PSPP_TEST_CMD}; + +if ( ! $pspp_cmd) +{ + $pspp_cmd="pspp"; +} + sub run_pspp_syntax { my $tempdir = shift; @@ -31,7 +38,7 @@ sub run_pspp_syntax print FH "$syntax"; close (FH); - system ("cd $tempdir; pspp -o raw-ascii $syntaxfile"); + system ("cd $tempdir; $pspp_cmd -o raw-ascii $syntaxfile"); } sub run_pspp_syntax_cmp -- 2.30.2