File: 10compile_dtd.t

package info (click to toggle)
libvcp-perl 0.9-20041020-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,608 kB
  • ctags: 833
  • sloc: perl: 18,190; sh: 11
file content (39 lines) | stat: -rw-r--r-- 910 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/local/bin/perl -w

=head1 NAME

10compile_dtd.t - testing of compile_dtd command

=cut

use strict ;

use Carp ;
use Test ;
use IPC::Run3 ;
use VCP::TestUtils qw( compile_dtd_cmd );

## 2.29's content model as object tree code for compiling DTDs
my $have_expat = eval "require XML::Parser; \$XML::Parser::VERSION >= 2.29";

my @compile_dtd = compile_dtd_cmd ;

# run compile_dtd command line with given parameters
sub compile_dtd {
   my $exp_results = shift ;
   my $out ;
   my $err ;
   my $pid = IPC::Run3::run3 [ @compile_dtd, @_ ], \undef, \$out, \$err ;
   confess "compile_dtd ", join( ' ', @_ ), " returned $?\n$out$err"
      if defined $exp_results && ! grep $? == $_ << 8, @$exp_results ;
   return $err . $out ;
}


my @tests = (
sub { ok compile_dtd( [ 0 ], "revml.dtd", "-" ) },
) ;

plan tests => scalar( @tests ) ;

$have_expat ? $_->() : skip "Need XML::Expat >= 2.29", 1 for @tests ;