[gnumeric] Tests: also test that the gnumeric exporter is deterministic.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Tests: also test that the gnumeric exporter is deterministic.
- Date: Mon, 8 Aug 2016 20:04:31 +0000 (UTC)
commit dde00b4002a7983b1ac93a6db22b0aed35a2c526
Author: Morten Welinder <terra gnome org>
Date: Mon Aug 8 16:03:32 2016 -0400
Tests: also test that the gnumeric exporter is deterministic.
Determinism isn't strictly speaking necessary, but it is a very pleasant
property to have for testing.
NEWS | 1 +
test/Makefile.am | 1 +
test/t6162-gnumeric-deterministic.pl | 64 ++++++++++++++++++++++++++++++++++
3 files changed, 66 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 2483ee3..66e30af 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Morten:
* Fix criteria function issue with errors in the selector area.
* Fix corner case for MINA and MAXA.
* Fix criteria matching of numbers against strings.
+ * Test suite improvements.
--------------------------------------------------------------------------
Gnumeric 1.12.31
diff --git a/test/Makefile.am b/test/Makefile.am
index 69e3a6d..377ca03 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -86,6 +86,7 @@ TESTS = t1000-statfuns.pl \
t6152-xlsx-syntax.pl \
t6160-ods-deterministic.pl \
t6161-xlsx-deterministic.pl \
+ t6162-gnumeric-deterministic.pl \
t6500-strings.pl \
t6501-numbers.pl \
t6502-styles.pl \
diff --git a/test/t6162-gnumeric-deterministic.pl b/test/t6162-gnumeric-deterministic.pl
new file mode 100755
index 0000000..bdec896
--- /dev/null
+++ b/test/t6162-gnumeric-deterministic.pl
@@ -0,0 +1,64 @@
+#!/usr/bin/perl -w
+# -----------------------------------------------------------------------------
+
+use strict;
+use lib ($0 =~ m|^(.*/)| ? $1 : ".");
+use GnumericTest;
+
+&message ("Check that the gnumeric exporter produces the same results every time.");
+
+my $format = "Gnumeric_XmlIO:sax:0";
+
+my @sources = &GnumericTest::corpus();
+# datefuns and docs-samples use NOW()
+@sources = grep { !m{(^|/)(datefuns\.xls|docs-samples\.gnumeric)$} } @sources;
+
+my $nskipped = 0;
+my $ngood = 0;
+my $nbad = 0;
+
+foreach my $src (@sources) {
+ if (!-r $src) {
+ $nskipped++;
+ next;
+ }
+
+ print STDERR "Checking $src\n";
+
+ my @data;
+ foreach my $i (1, 2) {
+ my $tmp = $src;
+ $tmp =~ s|^.*/||;
+ $tmp =~ s|\..*|-$i.gnumeric|;
+ &GnumericTest::junkfile ($tmp);
+ my $cmd = "$ssconvert -T $format $src $tmp";
+ print STDERR "# $cmd\n" if $GnumericTest::verbose;
+ system ($cmd);
+ if (!-r $tmp) {
+ print STDERR "ssconvert failed to produce $tmp\n";
+ die "Fail\n";
+ }
+
+ push @data, &GnumericTest::read_file ($tmp);
+ &GnumericTest::removejunk ($tmp);
+ }
+
+ if ($data[0] ne $data[1]) {
+ print STDERR "Generates output for $src is not deterministic.\n";
+ $nbad++;
+ } else {
+ $ngood++;
+ }
+}
+
+&GnumericTest::report_skip ("No source files present") if $nbad + $ngood == 0;
+
+if ($nskipped > 0) {
+ print STDERR "$nskipped files skipped.\n";
+}
+
+if ($nbad > 0) {
+ die "Fail\n";
+} else {
+ print STDERR "Pass\n";
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]