[gnumeric] Tests: add a test for a very simple graph.



commit 2e342f613a9b2aadbde60516c0dff34431c71349
Author: Morten Welinder <terra gnome org>
Date:   Mon Apr 14 13:03:59 2014 -0400

    Tests: add a test for a very simple graph.
    
    Note, that even Gnumeric round trip fails.  That means that the sample
    file probably should not be edited until that failure is taken care of.

 samples/graph-tests.gnumeric |  Bin 0 -> 2370 bytes
 test/Makefile.am             |    1 +
 test/t6516-graph.pl          |   50 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/samples/graph-tests.gnumeric b/samples/graph-tests.gnumeric
new file mode 100644
index 0000000..18eedda
Binary files /dev/null and b/samples/graph-tests.gnumeric differ
diff --git a/test/Makefile.am b/test/Makefile.am
index 17fbf30..14e3218 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -90,6 +90,7 @@ TESTS =       t1000-statfuns.pl                       \
        t6513-merges.pl                         \
        t6514-rich-text.pl                      \
        t6515-cond-format.pl                    \
+       t6516-graph.pl                          \
        t7000-goal-seek.pl                      \
        t7100-solver-blend.pl                   \
        t7101-solver-afiro.pl                   \
diff --git a/test/t6516-graph.pl b/test/t6516-graph.pl
new file mode 100755
index 0000000..9f27b41
--- /dev/null
+++ b/test/t6516-graph.pl
@@ -0,0 +1,50 @@
+#!/usr/bin/perl -w
+# -----------------------------------------------------------------------------
+
+use strict;
+use lib ($0 =~ m|^(.*/)| ? $1 : ".");
+use GnumericTest;
+
+my $file = "$samples/graph-tests.gnumeric";
+
+&message ("Check graph gnumeric roundtrip.");
+&test_roundtrip ($file,
+                'format' => 'Gnumeric_XmlIO:sax',
+                'ext' => "gnm",
+                'ignore_failure' => 1);
+
+&message ("Check graph ods roundtrip.");
+&test_roundtrip ($file,
+                'format' => 'Gnumeric_OpenCalc:odf',
+                'ext' => "ods",
+                'filter2' => "$PERL -p -e '\$_ = \"\" if m{<meta:generator>}'",
+                'ignore_failure' => 1);
+
+my $xls_codepage_filter = "$PERL -p -e '\$_ = \"\" if m{<meta:user-defined meta:name=.msole:codepage.}'";
+
+# xls/biff cannot handle format in graphs.
+my $xls_cond_format_filter = "$PERL -p -e 'if (m{<gnm:Condition\\b} ... m{</gnm:Condition\\b}) { 
s{\\s+Format=\"[^\"\"]*\"}{}; }'";
+
+&message ("Check graph xls/BIFF7 roundtrip.");
+&test_roundtrip ($file,
+                'format' => 'Gnumeric_Excel:excel_biff7',
+                'ext' => "xls",
+                'resize' => '16384x256',
+                # 'filter1' => $xls_cond_format_filter,
+                'filter2' => $xls_codepage_filter,
+                'ignore_failure' => 1);
+
+&message ("Check graph xls/BIFF8 roundtrip.");
+&test_roundtrip ($file,
+                'format' => 'Gnumeric_Excel:excel_biff8',
+                'ext' => "xls",
+                '# filter1' => $xls_cond_format_filter,
+                'filter2' => $xls_codepage_filter,
+                'ignore_failure' => 1);
+
+&message ("Check graph xlsx roundtrip.");
+&test_roundtrip ($file,
+                'format' => 'Gnumeric_Excel:xlsx',
+                'ext' => "xlsx",
+                'resize' => '1048576x16384',
+                'ignore_failure' => 1);


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