diff options
author | Niko Tyni <ntyni@debian.org> | 2009-04-14 22:55:33 +0300 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-04-16 23:18:46 +0200 |
commit | c1a2df7619e7315b8fccef3b9fa56bb8d7df3845 (patch) | |
tree | 4c9d9ce1d181ddc51aef54a22f6757cbcb0ca55c /lib/h2ph.t | |
parent | 76c8ecbc54b31e8777973e2fc92e1611ce7a4cb6 (diff) | |
download | perl-c1a2df7619e7315b8fccef3b9fa56bb8d7df3845.tar.gz |
Add tests to verify that h2ph output compiles and is warning free
The #include directives are #ifdef'd out so that running the
resulting code does not actually need the headers. We still
get the same effect from comparing with the expected h2ph output.
Diffstat (limited to 'lib/h2ph.t')
-rwxr-xr-x | lib/h2ph.t | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/h2ph.t b/lib/h2ph.t index 7b339b3927..e303406380 100755 --- a/lib/h2ph.t +++ b/lib/h2ph.t @@ -15,7 +15,7 @@ if (!(-e $extracted_program)) { exit 0; } -print "1..2\n"; +print "1..4\n"; # quickly compare two text files sub txt_compare { @@ -32,6 +32,14 @@ print(($ok == 0 ? "" : "not "), "ok 1\n"); $ok = txt_compare("lib/h2ph.ph", "lib/h2ph.pht"); print(($ok == 0 ? "" : "not "), "ok 2\n"); +# does the output compile? +$ok = system($^X, "-I../lib", "lib/h2ph.pht"); +print(($ok == 0 ? "" : "not "), "ok 3\n"); + +# is the output warning free? +$ok = system($^X, "-w", "-I../lib", "-e", '$SIG{__WARN__} = sub { die $_[0] }; require "lib/h2ph.pht"'); +print(($ok == 0 ? "" : "not "), "ok 4\n"); + # cleanup - should this be in an END block? unlink("lib/h2ph.ph"); unlink("_h2ph_pre.ph"); |