summaryrefslogtreecommitdiff
path: root/t/lib
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@debian.org>2009-04-14 22:55:33 +0300
committerDavid Mitchell <davem@iabyn.com>2009-04-22 21:13:04 +0100
commit2d375d52dd1895b26a80209dd64a3c11b9e3b532 (patch)
tree181a896cb95f43ca84d915407e2309c2518abee6 /t/lib
parentf2e7e84e3c34f041482c7dfe6e7142097aa42278 (diff)
downloadperl-2d375d52dd1895b26a80209dd64a3c11b9e3b532.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. (cherry picked from commit c1a2df7619e7315b8fccef3b9fa56bb8d7df3845)
Diffstat (limited to 't/lib')
-rw-r--r--t/lib/h2ph.h2
-rw-r--r--t/lib/h2ph.pht20
2 files changed, 13 insertions, 9 deletions
diff --git a/t/lib/h2ph.h b/t/lib/h2ph.h
index 495789a206..23f259e37e 100644
--- a/t/lib/h2ph.h
+++ b/t/lib/h2ph.h
@@ -68,9 +68,11 @@ function Tru64_Pascal(n: Integer): Integer;
* with `use lib qw(/opt/perl5/lib/site_perl/i586-linux/linux);' or whatever
* your equivalent is...
*/
+#if 0
#include <sys/socket.h>
#import "sys/ioctl.h"
#include_next <sys/fcntl.h>
+#endif
/* typedefs should be ignored */
typedef struct a_struct {
diff --git a/t/lib/h2ph.pht b/t/lib/h2ph.pht
index 145e6824ae..01db98d523 100644
--- a/t/lib/h2ph.pht
+++ b/t/lib/h2ph.pht
@@ -47,15 +47,17 @@ unless(defined(&_H2PH_H_)) {
} else {
eval 'sub WHATEVER () {1000;}' unless defined(&WHATEVER);
}
- require 'sys/socket.ph';
- require 'sys/ioctl.ph';
- eval {
- my(@REM);
- my(%INCD) = map { $INC{$_} => 1 } (grep { $_ eq "sys/fcntl.ph" } keys(%INC));
- @REM = map { "$_/sys/fcntl.ph" } (grep { not exists($INCD{"$_/sys/fcntl.ph"}) and -f "$_/sys/fcntl.ph" } @INC);
- require "$REM[0]" if @REM;
- };
- warn($@) if $@;
+ if(0) {
+ require 'sys/socket.ph';
+ require 'sys/ioctl.ph';
+ eval {
+ my(@REM);
+ my(%INCD) = map { $INC{$_} => 1 } (grep { $_ eq "sys/fcntl.ph" } keys(%INC));
+ @REM = map { "$_/sys/fcntl.ph" } (grep { not exists($INCD{"$_/sys/fcntl.ph"}) and -f "$_/sys/fcntl.ph" } @INC);
+ require "$REM[0]" if @REM;
+ };
+ warn($@) if $@;
+ }
eval("sub sun () { 0; }") unless defined(&sun);
eval("sub mon () { 1; }") unless defined(&mon);
eval("sub tue () { 2; }") unless defined(&tue);