Commit dde00b40 authored by Morten Welinder's avatar Morten Welinder

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.
parent 5e8ea469
......@@ -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
......
......@@ -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 \
......
#!/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";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment