[gnumeric] Tests: test also chart files from xlsx files.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Tests: test also chart files from xlsx files.
- Date: Sat, 17 Jan 2015 22:20:16 +0000 (UTC)
commit aa4e11a096f1628291672994630c6a4ab4397583
Author: Morten Welinder <terra gnome org>
Date: Sat Jan 17 17:17:42 2015 -0500
Tests: test also chart files from xlsx files.
This shows a boatload of problems to be fixed shortly.
test/t6152-xlsx-syntax.pl | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/test/t6152-xlsx-syntax.pl b/test/t6152-xlsx-syntax.pl
index 0c65e0d..0405419 100755
--- a/test/t6152-xlsx-syntax.pl
+++ b/test/t6152-xlsx-syntax.pl
@@ -15,6 +15,11 @@ if (!-r $schema) {
&message ("Schema $schema not found");
$schema = undef;
}
+my $chart_schema = "$topsrc/test/ooxml-schema/dml-chart.xsd";
+if (!-r $chart_schema) {
+ &message ("Schema $chart_schema not found");
+ $chart_schema = undef;
+}
my $xmllint = &GnumericTest::find_program ("xmllint");
my $unzip = &GnumericTest::find_program ("unzip");
@@ -79,8 +84,9 @@ my $nskipped = 0;
my $ngood = 0;
my $nbad = 0;
-my $checker = "$xmllint --noout";
-$checker .= " --schema $schema" if defined $schema;
+my $checker = "$xmllint --noout" . ($schema ? " --schema $schema" : "");
+my $chart_checker = "$xmllint --noout" . ($chart_schema ? " --schema $chart_schema" : "");
+my %checkers = ( 0 => $checker, 1 => $chart_checker );
foreach my $src (@sources) {
if (!-r $src) {
@@ -112,14 +118,17 @@ foreach my $src (@sources) {
$members{$member} = 1;
}
- my @check_members = ('xl/workbook.xml', 'xl/styles.xml');
- push @check_members, 'xl/sharedStrings.xml' if $members{'xl/sharedStrings.xml'};
+ my @check_members = (['xl/workbook.xml',0] , ['xl/styles.xml', 0]);
+ push @check_members, ['xl/sharedStrings.xml',0] if $members{'xl/sharedStrings.xml'};
foreach my $member (sort keys %members) {
- push @check_members, $member if $member =~ m{^xl/worksheets/sheet\d+\.xml$};
+ push @check_members, [$member,0] if $member =~ m{^xl/worksheets/sheet\d+\.xml$};
+ push @check_members, [$member,1] if $member =~ m{^xl/charts/chart\d+\.xml$};
}
- for my $member (@check_members) {
- my $out = `$unzip -p $tmp $member | $checker - 2>&1`;
+ for (@check_members) {
+ my ($member,$typ) = @$_;
+ my $this_checker = $checkers{$typ};
+ my $out = `$unzip -p $tmp $member | $this_checker - 2>&1`;
if ($out ne '' && $out !~ /validates$/) {
print STDERR "While checking $member from $tmp:\n";
&GnumericTest::dump_indented ($out);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]