You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by "Jason E. Stewart" <ja...@openinformatics.com> on 2001/03/15 01:36:58 UTC
Changes in CVS
Hey All,
I've just checked in the changes into CVS:
* now works with SWIG 1.1 and 1.3
* namespace is now XML::Xerces
* special Perl API for functions returning DOM_NodeList and
DOM_NamedNodeMap
* special input classes removed
* all tests updated
Harmon,
I left the New_classes_perl directory, with perlErrorHandler.cpp and
perlErrorHandler.swig.cpp just to keep things tidy.
I modified all the test scripts so that:
* common functionality was moved into a module, TestUtils.pm
* all tests now trap warnings with $SIG{__WARN__} = 'IGNORE' to stop
the irritating SWIG warnings
* added standard test headers to all files.
This has simplified the tests a lot. For example, here's the whole of
MemBufInputSource.t:
-- begin --
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl
# MemBufInputSource.t'
######################### We start with some black magic to print on failure.
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
BEGIN { $| = 1; print "1..2\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
use XML::Xerces;
use lib 't';
use TestUtils qw(result $DOM $PERSONAL);
# turn off annoying warnings
$SIG{__WARN__} = 'IGNORE';
$loaded = 1;
my $i = 1;
result(1,$i), $i++;
######################### End of black magic.
# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
$DOM->parse( new XML::Xerces::MemBufInputSource($PERSONAL, 'foo') );
my $serialize = $DOM->getDocument->serialize;
result($serialize eq $PERSONAL, $i), $i++;
-- end --
Notice:
* $DOM: an already created XML::Xerces::DOMParser instance with the
error handler set.
* $PERSONAL: the already parsed in contents of 'personal.xml'
* result(), given a condition, and a counter variable this function
handles the printing of 'ok 5' or 'not ok 5'
this way the only new code for each test is just the stuff specific
for that test.
Try it out, and if there aren't any problems, I'll cut
XML-Xerces-1.3.2 and upload it to xml.apache.org
jas.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-p-dev-help@xml.apache.org