[gnumeric] Tests: add ssdiff tests.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Tests: add ssdiff tests.
- Date: Fri, 17 Mar 2017 19:34:39 +0000 (UTC)
commit 62634104e5d04586ddfde6e30eaa05cb8f78c465
Author: Morten Welinder <terra gnome org>
Date: Fri Mar 17 14:36:18 2017 -0400
Tests: add ssdiff tests.
test/Makefile.am | 1 +
test/t9002-ssdiff-self.pl | 58 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+), 0 deletions(-)
---
diff --git a/test/Makefile.am b/test/Makefile.am
index 4cbadc6..f13f189 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -162,6 +162,7 @@ TESTS = t1000-statfuns.pl \
t8202-gslice3.pl \
t9000-ssindex.pl \
t9001-ssconvert-resize.pl \
+ t9002-ssdiff-self.pl \
t9100-number-match.pl \
t9999-epilogue.pl
diff --git a/test/t9002-ssdiff-self.pl b/test/t9002-ssdiff-self.pl
new file mode 100755
index 0000000..cc7856f
--- /dev/null
+++ b/test/t9002-ssdiff-self.pl
@@ -0,0 +1,58 @@
+#!/usr/bin/perl -w
+# -----------------------------------------------------------------------------
+
+use strict;
+use lib ($0 =~ m|^(.*/)| ? $1 : ".");
+use GnumericTest;
+
+&message ("Check ssdiff on identical files");
+
+my @sources = &GnumericTest::corpus();
+# Remove stuff that currently fails. (Not yet investigated.)
+@sources = grep { !/dbfuns\.xls/} @sources;
+@sources = grep { !/operator\.xls/} @sources;
+@sources = grep { !/cellstyle\.xlsx/} @sources;
+
+my $ngood = 0;
+my $nbad = 0;
+my $nskipped = 0;
+
+for my $src (@sources) {
+ if (!-r $src) {
+ $nskipped += 2;
+ next;
+ }
+
+ print STDERR "$src...\n";
+
+ my $cmd = "$ssdiff --xml $src $src";
+ my $output = `$cmd 2>&1`;
+ my $err = $?;
+ if ($err) {
+ &GnumericTest::dump_indented ($output);
+ $nbad++;
+ die "Failed command: $cmd [$err]\n" if $err > (1 << 8);
+ } else {
+ if ($output =~ m'<\?xml version="1\.0" encoding="UTF-8"\?>
+<ssdiff:Diff>
+( <ssdiff:Sheet Name=".*" Old="\d+" New="\d+"/>
+)*</ssdiff:Diff>') {
+ $ngood++;
+ } else {
+ &GnumericTest::dump_indented ($output);
+ $nbad++;
+ }
+ }
+}
+
+&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]