[gnumeric] test: handle out-of-tree build better.



commit b4963a4bbd71b328297a6ac922e6a3ad7bdfdafa
Author: Morten Welinder <terra gnome org>
Date:   Sat Nov 28 16:53:52 2009 -0500

    test: handle out-of-tree build better.

 test/ChangeLog       |    4 ++++
 test/GnumericTest.pm |   23 ++++++++++++++---------
 2 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/test/ChangeLog b/test/ChangeLog
index b15d61b..dffe48e 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-28  Morten Welinder <terra gnome org>
+
+	* GnumericTest.pm: Handle out-of-tree build.
+
 2009-11-01  Morten Welinder <terra gnome org>
 
 	* Release 1.9.15
diff --git a/test/GnumericTest.pm b/test/GnumericTest.pm
index 76b91e9..e9b11e2 100644
--- a/test/GnumericTest.pm
+++ b/test/GnumericTest.pm
@@ -8,17 +8,22 @@ use XML::Parser;
 @GnumericTest::ISA = qw (Exporter);
 @GnumericTest::EXPORT = qw(test_sheet_calc test_importer test_valgrind
 			   test_ssindex sstest test_command message
-			   $ssconvert $sstest $topsrc $samples $PERL);
+			   $ssconvert $sstest $topsrc $top_builddir
+			   $samples $PERL);
 @GnumericTest::EXPORT_OK = qw(junkfile);
 
-use vars qw($topsrc $samples $PERL $verbose);
+use vars qw($topsrc $top_builddir $samples $PERL $verbose);
 use vars qw($ssconvert $ssindex $sstest);
-$topsrc = "..";
+
+$topsrc = $0;
+$topsrc =~ s|/[^/]+$|/..|;
+$topsrc =~ s|/test/\.\.$||;
+
+$top_builddir = "..";
 $samples = "$topsrc/samples";
-# FIXME.  The binaries might not be in the source tree.
-$ssconvert = "$topsrc/src/ssconvert";
-$ssindex = "$topsrc/src/ssindex";
-$sstest = "$topsrc/src/sstest";
+$ssconvert = "$top_builddir/src/ssconvert";
+$ssindex = "$top_builddir/src/ssindex";
+$sstest = "$top_builddir/src/sstest";
 $verbose = 0;
 $PERL = $Config{'perlpath'};
 $PERL .= $Config{'_exe'} if $^O ne 'VMS' && $PERL !~ m/$Config{'_exe'}$/i;
@@ -324,13 +329,13 @@ sub test_valgrind {
     $cmd = "--gen-suppressions=all $cmd";
 
     {
-	my $suppfile = "common.supp";
+	my $suppfile = "$topsrc/test/common.supp";
 	&report_skip ("file $suppfile does not exist") unless -r $suppfile;
 	$cmd = "--suppressions=$suppfile $cmd" if -r $suppfile;
     }
 
     if ($valvers >= 30500) {
-	my $suppfile = "commondots.supp";
+	my $suppfile = "$topsrc/test/commondots.supp";
 	$cmd = "--suppressions=$suppfile $cmd" if -r $suppfile;
     }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]