gnumeric r16268 - branches/gnumeric-1-8/test



Author: mortenw
Date: Thu Jan 10 19:30:52 2008
New Revision: 16268
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16268&view=rev

Log:
2008-01-10  Morten Welinder  <terra gnome org>

	* GnumericTest.pm (test_valgrind): Handle older valgrinds.
	(test_importer): Skip if source file is missing.



Modified:
   branches/gnumeric-1-8/test/ChangeLog
   branches/gnumeric-1-8/test/GnumericTest.pm
   branches/gnumeric-1-8/test/t8000-valgrind.pl
   branches/gnumeric-1-8/test/t8001-valgrind-xls.pl
   branches/gnumeric-1-8/test/t8002-valgrind-gnumeric.pl
   branches/gnumeric-1-8/test/t8003-valgrind-pdf.pl
   branches/gnumeric-1-8/test/t8004-valgrind-xls-macro.pl
   branches/gnumeric-1-8/test/t8005-valgrind-chart-fit.pl

Modified: branches/gnumeric-1-8/test/GnumericTest.pm
==============================================================================
--- branches/gnumeric-1-8/test/GnumericTest.pm	(original)
+++ branches/gnumeric-1-8/test/GnumericTest.pm	Thu Jan 10 19:30:52 2008
@@ -192,6 +192,8 @@
 	&junkfile ($tmp);
     }
 
+    &report_skip ("file $file does not exist") unless -r $file;
+
     my $code = system ("$ssconvert '$file' '$tmp' 2>&1 | sed -e 's/^/| /'");
     &system_failure ($ssconvert, $code) if $code;
 
@@ -258,6 +260,9 @@
     die "Cannot remove $outfile.\n" if -f $outfile;
     &junkfile ($outfile);
 
+    my $valhelp = `valgrind --help 2>&1`;
+    die "Problem running valgrind.\n" unless $valhelp =~ /log-file/;
+
     $cmd = "--gen-suppressions=all $cmd";
     {
 	my $suppfile = "common.supp";
@@ -274,7 +279,11 @@
     $cmd = "--leak-check=full $cmd";
     $cmd = "--num-callers=20 $cmd";
     $cmd = "--track-fds=yes $cmd";
-    $cmd = "--log-file=$outfile $cmd";
+    if ($valhelp =~ /--log-file-exactly=/) {
+	$cmd = "--log-file-exactly=$outfile $cmd";
+    } else {
+	$cmd = "--log-file=$outfile $cmd";
+    }
     $cmd = "valgrind $cmd";
     $cmd = "../libtool --mode=execute $cmd" if $uselibtool;
 
@@ -301,6 +310,8 @@
 sub test_ssindex {
     my ($file,$test) = @_;
 
+    &report_skip ("file $file does not exist") unless -r $file;
+
     my $xmlfile = fileparse ($file);
     $xmlfile =~ s/\.[a-zA-Z0-9]+$/.xml/;
     unlink $xmlfile;

Modified: branches/gnumeric-1-8/test/t8000-valgrind.pl
==============================================================================
--- branches/gnumeric-1-8/test/t8000-valgrind.pl	(original)
+++ branches/gnumeric-1-8/test/t8000-valgrind.pl	Thu Jan 10 19:30:52 2008
@@ -6,6 +6,11 @@
 use GnumericTest;
 
 &message ("Check the core with valgrind.");
+
+my $src = "$samples/excel/statfuns.xls";
+&GnumericTest::report_skip ("file $src does not exist") unless -r $src;
+
 my $tmp = "statfuns.gnumeric";
 &GnumericTest::junkfile ($tmp);
-&test_valgrind ("$ssconvert --recalc $samples/excel/statfuns.xls $tmp", 1);
+
+&test_valgrind ("$ssconvert --recalc $src $tmp", 1);

Modified: branches/gnumeric-1-8/test/t8001-valgrind-xls.pl
==============================================================================
--- branches/gnumeric-1-8/test/t8001-valgrind-xls.pl	(original)
+++ branches/gnumeric-1-8/test/t8001-valgrind-xls.pl	Thu Jan 10 19:30:52 2008
@@ -6,6 +6,11 @@
 use GnumericTest;
 
 &message ("Check the xls importer and exporter with valgrind.");
+
+my $src = "$samples/excel/statfuns.xls";
+&GnumericTest::report_skip ("file $src does not exist") unless -r $src;
+
 my $tmp = "statfuns.xls";
 &GnumericTest::junkfile ($tmp);
-&test_valgrind ("$ssconvert $samples/excel/statfuns.xls $tmp", 1);
+
+&test_valgrind ("$ssconvert $src $tmp", 1);

Modified: branches/gnumeric-1-8/test/t8002-valgrind-gnumeric.pl
==============================================================================
--- branches/gnumeric-1-8/test/t8002-valgrind-gnumeric.pl	(original)
+++ branches/gnumeric-1-8/test/t8002-valgrind-gnumeric.pl	Thu Jan 10 19:30:52 2008
@@ -6,6 +6,11 @@
 use GnumericTest;
 
 &message ("Check the gnumeric importer and exporter with valgrind.");
+
+my $src = "$samples/regress.gnumeric";
+&GnumericTest::report_skip ("file $src does not exist") unless -r $src;
+
 my $tmp = "regress.gnumeric";
 &GnumericTest::junkfile ($tmp);
-&test_valgrind ("$ssconvert $samples/regress.gnumeric $tmp", 1);
+
+&test_valgrind ("$ssconvert $src $tmp", 1);

Modified: branches/gnumeric-1-8/test/t8003-valgrind-pdf.pl
==============================================================================
--- branches/gnumeric-1-8/test/t8003-valgrind-pdf.pl	(original)
+++ branches/gnumeric-1-8/test/t8003-valgrind-pdf.pl	Thu Jan 10 19:30:52 2008
@@ -6,11 +6,15 @@
 use GnumericTest;
 
 &message ("Check the pdf exporter with valgrind -- part 1.");
+my $src = "$samples/excel/statfuns.xls";
+&GnumericTest::report_skip ("file $src does not exist") unless -r $src;
 my $tmp = "statfuns.pdf";
 &GnumericTest::junkfile ($tmp);
-&test_valgrind ("$ssconvert $samples/excel/statfuns.xls $tmp", 1);
+&test_valgrind ("$ssconvert $src $tmp", 1);
 
 &message ("Check the pdf exporter with valgrind -- part 2.");
+my $src2 = "$samples/excel12/cellstyle.xlsx";
+&GnumericTest::report_skip ("file $src2 does not exist") unless -r $src2;
 my $tmp2 = "cellstyle.pdf";
 &GnumericTest::junkfile ($tmp2);
-&test_valgrind ("$ssconvert $samples/excel12/cellstyle.xlsx $tmp2", 1);
+&test_valgrind ("$ssconvert $src2 $tmp2", 1);

Modified: branches/gnumeric-1-8/test/t8004-valgrind-xls-macro.pl
==============================================================================
--- branches/gnumeric-1-8/test/t8004-valgrind-xls-macro.pl	(original)
+++ branches/gnumeric-1-8/test/t8004-valgrind-xls-macro.pl	Thu Jan 10 19:30:52 2008
@@ -8,6 +8,11 @@
 # See #490828
 
 &message ("Check the xls importer and exporter with valgrind.");
+
+my $src = "$samples/excel/sort.xls";
+&GnumericTest::report_skip ("file $src does not exist") unless -r $src;
+
 my $tmp = "sort.xls";
 &GnumericTest::junkfile ($tmp);
-&test_valgrind ("$ssconvert $samples/excel/sort.xls $tmp", 1);
+
+&test_valgrind ("$ssconvert $src $tmp", 1);

Modified: branches/gnumeric-1-8/test/t8005-valgrind-chart-fit.pl
==============================================================================
--- branches/gnumeric-1-8/test/t8005-valgrind-chart-fit.pl	(original)
+++ branches/gnumeric-1-8/test/t8005-valgrind-chart-fit.pl	Thu Jan 10 19:30:52 2008
@@ -8,6 +8,11 @@
 # See #492158
 
 &message ("Check some graph fitting with valgrind.");
+
+my $src = "$samples/chart-smooth-fit-tests.gnumeric";
+&GnumericTest::report_skip ("file $src does not exist") unless -r $src;
+
 my $tmp = "chart.xls";
 &GnumericTest::junkfile ($tmp);
-&test_valgrind ("$ssconvert $samples/chart-smooth-fit-tests.gnumeric $tmp", 1);
+
+&test_valgrind ("$ssconvert $src $tmp", 1);



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