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,
32 args => ['-d.', '-Q', 'lib/h2ph.h']);
33 is( $?, 0, "$extracted_program runs successfully" );
35 is ( txt_compare("lib/h2ph.ph", "lib/h2ph.pht"),
37 "generated file has expected contents" );
39 $result = runperl( progfile => 'lib/h2ph.pht',
42 like( $result, qr/syntax OK$/, "output compiles");
44 $result = runperl( switches => ["-w"],
45 prog => '$SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht);');
46 is( $result, '', "output free of warnings" );
50 1 while unlink("lib/h2ph.ph");
51 1 while unlink("_h2ph_pre.ph");