.gnumeric: if we see a shared array formula, fix it.
[gnumeric.git] / test / t6590-samples.pl
blob92c66df5d3b14b247f8c7f860399a021ac9fec6e
1 #!/usr/bin/perl -w
2 # -----------------------------------------------------------------------------
4 use strict;
5 use lib ($0 =~ m|^(.*/)| ? $1 : ".");
6 use GnumericTest;
7 $GnumericTest::default_subtests = '*,-biff7';
9 my $csvfile = "samples.csv";
10 &GnumericTest::junkfile ($csvfile);
12 my $cmd = "$sstest --samples-file=$csvfile";
13 print STDERR "# $cmd\n" if $GnumericTest::verbose;
14 system ($cmd);
15 if (!-r $csvfile) {
16 print STDERR "gnumeric failed to produce $csvfile\n";
17 die "Fail\n";
21 my $file = "samples.gnumeric";
22 &GnumericTest::junkfile ($file);
24 my $cmd = "$ssconvert $csvfile $file";
25 print STDERR "# $cmd\n" if $GnumericTest::verbose;
26 system ($cmd);
27 if (!-r $file) {
28 print STDERR "ssconvert failed to produce $file\n";
29 die "Fail\n";
32 &GnumericTest::removejunk ($csvfile);
35 if (&subtest ("gnumeric")) {
36 &message ("Check documentation samples gnumeric roundtrip.");
37 &test_roundtrip ($file,
38 'format' => 'Gnumeric_XmlIO:sax',
39 'ext' => "gnm");
42 if (&subtest ("ods")) {
43 &message ("Check documentation samples ods roundtrip.");
45 # Replace calls to boolean functions with constants
46 my $bool_func_filter = "$PERL -p -e 's{\\b(true|false)\\(\\)}{uc(\$1)}e'";
47 my $concat_filter = "$PERL -p -e 's{\\bconcatenate\\b}{concat} and s{\\baa\\b}{bb}'";
49 &test_roundtrip ($file,
50 'format' => 'Gnumeric_OpenCalc:odf',
51 'ext' => "ods",
52 'filter0' => "$bool_func_filter | $concat_filter",
53 'filter2' => 'std:drop_generator',
54 'ignore_failure' => 1);
57 if (&subtest ("biff7")) {
58 &message ("Check documentation samples xls/BIFF7 roundtrip.");
59 &test_roundtrip ($file,
60 'format' => 'Gnumeric_Excel:excel_biff7',
61 'ext' => "xls",
62 'resize' => '16384x256',
63 'filter2' => 'std:drop_codepage',
64 'ignore_failure' => 1);
67 if (&subtest ("biff8")) {
68 &message ("Check documentation samples xls/BIFF8 roundtrip.");
69 &test_roundtrip ($file,
70 'format' => 'Gnumeric_Excel:excel_biff8',
71 'ext' => "xls",
72 'filter2' => 'std:drop_codepage',
73 'ignore_failure' => 1);
76 if (&subtest ("xlsx")) {
77 &message ("Check documentation samples xlsx roundtrip.");
79 # Don't care about cum argument being required in XL.
80 my $hypgeom_filter = "$PERL -p -e 'if (/\\bhypgeomdist\\b/) { s{,FALSE\\)}{)}'}";
82 &test_roundtrip ($file,
83 'format' => 'Gnumeric_Excel:xlsx',
84 'ext' => "xlsx",
85 'resize' => '1048576x16384',
86 'filter' => $hypgeom_filter,
87 'ignore_failure' => 1);