Ensure that perl module tests work before pspp has been installed
authorJohn Darrington <john@darrington.wattle.id.au>
Thu, 8 Jan 2009 08:23:53 +0000 (17:23 +0900)
committerJohn Darrington <john@darrington.wattle.id.au>
Thu, 8 Jan 2009 08:23:53 +0000 (17:23 +0900)
perl-module/Makefile.PL
perl-module/t/Pspp.t

index 77505f2f27ecaa5e4b5f14a1afdecb6938611992..20587a62fe575c54f1da8d752901c727a7c9a64d 100644 (file)
@@ -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 <john@darrington.wattle.id.au>') : ()),
     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"}
index 6e8510f883d6675c90386e2a8cc5c88109dce53e..fe141514cc34921aade4f7c17c266d550538cc2f 100644 (file)
@@ -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