Commits

Anonymous committed d205c99

- skip tests for unsupported features on unsupported versions of Perl/libxml2
- make Reader interface require Perl 5.8 (patches to extend to 5.6 are welcome)
- bumped version to 1.65 for a release

Comments (0)

Files changed (16)

 Revision history for Perl extension XML::LibXML
-1.65pre
+1.65
    - fix bug in t/40reader.t revealed by a bugfix in Test::More 0.71 (Jonathan Rockway)
    - fix possible SIGSEGV when PI's or attrs created with
      createDocument can get garbage-collected after their owning
      document (old-standing bug suddenly caught by XML::Compile regression tests)
+   - skip tests for unsupported features on unsupported versions of Perl/libxml2
+   - make Reader interface require Perl 5.8 (patches to extend to 5.6 are welcome)
 
 1.64
    - fix reconcilation of the "xml" namespace [rt.cpan.org #26450] 
 
 BEGIN {
 
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 require Exporter;
 require DynaLoader;
 @ISA = qw(DynaLoader Exporter);

lib/XML/LibXML/Boolean.pm

 
 use vars qw ($VERSION);
 
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use overload
         '""' => \&value,

lib/XML/LibXML/Literal.pm

 use strict;
 
 use vars qw ($VERSION);
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use overload 
 		'""' => \&value,

lib/XML/LibXML/NodeList.pm

 use XML::LibXML::Number;
 
 use vars qw ($VERSION);
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use overload 
 		'""' => \&to_literal,

lib/XML/LibXML/Number.pm

 use strict;
 
 use vars qw ($VERSION);
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use overload
         '""' => \&value,

lib/XML/LibXML/Reader.pm

 use warnings;
 
 use vars qw ($VERSION);
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use Carp;
+use 5.8.0;
 use base qw(Exporter);
 use constant {
     XML_READER_TYPE_NONE => 0,

lib/XML/LibXML/SAX.pm

 use strict;
 use vars qw($VERSION @ISA);
 
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 
 use XML::LibXML;
 use XML::SAX::Base;

lib/XML/LibXML/SAX/Builder.pm

 
 use vars qw ($VERSION);
 
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 
 sub new {
     my $class = shift;

lib/XML/LibXML/SAX/Generator.pm

 use XML::LibXML;
 use vars qw ($VERSION);
 
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 
 warn("This class (", __PACKAGE__, ") is deprecated!");
 

lib/XML/LibXML/SAX/Parser.pm

 use XML::SAX::Base;
 use XML::SAX::DocumentLocator;
 
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 @ISA = ('XML::SAX::Base');
 
 sub _parse_characterstream {

lib/XML/LibXML/XPathContext.pm

 use XML::LibXML;
 use XML::LibXML::NodeList;
 
-$VERSION = "1.64"; # VERSION TEMPLATE: DO NOT CHANGE
+$VERSION = "1.65"; # VERSION TEMPLATE: DO NOT CHANGE
 
 # should LibXML XPath data types be used for simple objects
 # when passing parameters to extension functions (default: no)
 BEGIN { plan tests => 3}
 END { ok(0) unless $loaded }
 use XML::LibXML;
+
 $loaded = 1;
 ok(1);
 
 
 ok(XML::LibXML::LIBXML_VERSION, XML::LibXML::LIBXML_RUNTIME_VERSION);
 
-# warn "# $tstr2\n";
+warn "\n\nCompiled against libxml2 version: ",XML::LibXML::LIBXML_VERSION,
+     "\nRunning libxml2 version:          ",XML::LibXML::LIBXML_RUNTIME_VERSION,
+     "\n\n";
   ok($htmldoc->URI, 'foo');
   ok($htmldoc->findvalue('//p/text()'), $utf_str);
 
-  if (XML::LibXML::LIBXML_VERSION >= 20627) {
+  if (1000*$] < 5008) {
+    skip("skipping for Perl < 5.8") for 1..2;
+  } elsif (20627 > XML::LibXML::LIBXML_VERSION) {
+    skip("skipping for libxml2 < 2.6.27") for 1..2;
+  } else {
     # translate to UTF8 on perl-side
     open $fh, '<:encoding(iso-8859-2)', $test_file;
     $htmldoc = $parser->parse_html_fh( $fh, { encoding => 'UTF-8' });
     close $fh;
     ok( $htmldoc && $htmldoc->getDocumentElement );
     ok($htmldoc->findvalue('//p/text()'), $utf_str);
-  } else {
-    skip("skipping for libxml2 <= 2.6.27") for 1..2;
   }
 }
 
   ok( $htmldoc && $htmldoc->getDocumentElement );
   ok($htmldoc->findvalue('//p/text()'), $utf_str);
 
-  # translate to UTF8 on perl-side
-  open $fh, '<:encoding(iso-8859-2)', $test_file;
-  $htmldoc = $parser->parse_html_fh( $fh, { encoding => 'UTF-8' } );
-  close $fh;
-  ok( $htmldoc && $htmldoc->getDocumentElement );
-  ok($htmldoc->findvalue('//p/text()'), $utf_str);
+  if (1000*$] < 5008) {
+    skip("skipping for Perl < 5.8") for 1..2;
+  } else {
+    # translate to UTF8 on perl-side
+    open $fh, '<:encoding(iso-8859-2)', $test_file;
+    $htmldoc = $parser->parse_html_fh( $fh, { encoding => 'UTF-8' } );
+    close $fh;
+    ok( $htmldoc && $htmldoc->getDocumentElement );
+    ok($htmldoc->findvalue('//p/text()'), $utf_str);
+  }
 }
 
 print "# exclusive canonicalization\n";
 
-{
+if (20620 > XML::LibXML::LIBXML_VERSION) {
+    skip("skipping Exclusive C14N tests for libxml2 < 2.6.17") for 15..20;
+} else {
   my $xml1 = <<EOX;
 <n0:local xmlns:n0="http://something.org" xmlns:n3="ftp://example.org">
   <n1:elem2 xmlns:n1="http://example.net" xml:lang="en">
 use XML::LibXML;
 
 BEGIN{
-  if (XML::LibXML::LIBXML_VERSION() >= 20621) {
+  if (1000*$] < 5008) {
+     plan skip_all => "Reader interface only supported in Perl >= 5.8";
+     exit;
+  } elsif (XML::LibXML::LIBXML_VERSION() <= 20620) {
+     plan skip_all => "Reader not supported for libxml2 <= 2.6.20";
+     exit;
+  } else {
      plan tests => 93;
-  } else {
-     plan skip_all => "Reader not supported for libxml2 <= 2.6.20";
   }
 
   use_ok('XML::LibXML::Reader');