4 # quickie tests to see if h2ph actually runs and does more or less what is
14 my $extracted_program = '../utils/h2ph'; # unix, nt, ...
15 if ($^O eq 'VMS') { $extracted_program = '[-.utils]h2ph.com'; }
16 if (!(-e $extracted_program)) {
17 print "1..0 # Skip: $extracted_program was not built\n";
23 # quickly compare two text files
27 for (($A,$B) = @_) { open(_,"<$_") ? $_ = <_> : die "$_ : $!"; close _ }
31 my $result = runperl( progfile => $extracted_program,
33 args => ['-d.', '-Q', 'lib/h2ph.h']);
34 is( $result, '', "output is free of warnings" );
35 is( $?, 0, "$extracted_program runs successfully" );
37 is ( txt_compare("lib/h2ph.ph", "lib/h2ph.pht"),
39 "generated file has expected contents" );
41 $result = runperl( progfile => 'lib/h2ph.pht',
44 like( $result, qr/syntax OK$/, "output compiles");
46 $result = runperl( progfile => '_h2ph_pre.ph',
49 like( $result, qr/syntax OK$/, "preamble compiles");
51 $result = runperl( switches => ["-w"],
54 $SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht);
56 is( $result, '', "output free of warnings" );
60 1 while unlink("lib/h2ph.ph");
61 1 while unlink("_h2ph_pre.ph");