Commit 9a60b5e4 authored by Morten Welinder's avatar Morten Welinder

Tests: make sure glade files can be parsed.

parent cf8deea4
#!/usr/bin/perl -w
# -----------------------------------------------------------------------------
use strict;
use lib ($0 =~ m|^(.*/)| ? $1 : ".");
use GnumericTest;
&message ("Check that glade files parse.");
my $checker = "tools/check-glade-parsing";
&GnumericTest::report_skip ("Missing tester") unless -r "$topsrc/$checker";
&test_command ("cd $topsrc && $PERL $checker", sub { /^$/ });
2009-08-18 Morten Welinder <terra@gnome.org>
* check-glade-parsing: New checker.
2009-08-15 Morten Welinder <terra@gnome.org>
* Release 1.9.10
......
SUBDIRS = win32
EXTRA_DIST = dumpdef.pl check-gfrees check-gtk-includes check-null-false-returns
EXTRA_DIST = dumpdef.pl \
check-gfrees \
check-gtk-includes \
check-null-false-returns \
check-glade-parsing
#!/usr/bin/perl -w
#
# Gnumeric
#
# Copyright (C) 2009 Morten Welinder.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this library; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Author: Morten Welinder <terra@gnome.org>
use strict;
use XML::Parser;
my $exitcode = 0;
die "$0: must be run from top-level directory.\n"
unless -r "configure.in" && -r 'ChangeLog';
my %exceptions = ();
my @files;
{
local (*FIND);
open (*FIND, "find . '(' -name \*.glade -type f -print ')' -o '(' -type d '(' -name CVS -o -name intl -o -name macros ')' -prune ')' |")
or die "$0: cannot execute find: $!\n";
foreach my $filename (<FIND>) {
chomp $filename;
$filename =~ s|^\./||;
next if $exceptions{$filename};
push @files, $filename;
}
close (*FIND);
}
{
my $parser = new XML::Parser ('Style' => 'Tree');
FILE:
foreach my $filename (@files) {
eval {
my $tree = $parser->parsefile ($filename);
};
if ($@) {
print STDERR "File $filename doesn't parse: $@\n";
$exitcode = 1;
}
}
}
exit $exitcode;
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