From: Nicholas Clark Date: Fri, 23 Jun 2000 16:21:15 +0000 (+0100) Subject: PATCH (Re: [ID 20000612.004] Should regression tests fail if user doesn't build XS... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=466293177e80bfc85decf1ba2eefeff19cb8070c;p=p5sagit%2Fp5-mst-13.2.git PATCH (Re: [ID 20000612.004] Should regression tests fail if user doesn't build XS extensions?) Message-ID: <20000623162115.A19894@Bagpuss.unfortu.net> p4raw-id: //depot/cfgperl@6270 --- diff --git a/t/lib/anydbm.t b/t/lib/anydbm.t index a7fca17..e304766 100755 --- a/t/lib/anydbm.t +++ b/t/lib/anydbm.t @@ -5,6 +5,11 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib'; + require Config; import Config; + if (($Config{'extensions'} !~ /\b(DB|[A-Z]DBM)_File\b/) ){ + print "1..0 # Skipping (no DB_File or [A-Z]DBM_File)\n"; + exit 0; + } } require AnyDBM_File; use Fcntl; diff --git a/t/lib/dprof.t b/t/lib/dprof.t index 4d6f782..fc5bd05 100755 --- a/t/lib/dprof.t +++ b/t/lib/dprof.t @@ -3,6 +3,11 @@ BEGIN { chdir( 't' ) if -d 't'; unshift @INC, '../lib'; + require Config; import Config; + if ($Config{'extensions'} !~ /\bDevel\/DProf\b/){ + print "1..0 # Skip: Devel::DProf was not built\n"; + exit 0; + } } END { @@ -11,7 +16,6 @@ END { use Benchmark qw( timediff timestr ); use Getopt::Std 'getopts'; -use Config '%Config'; getopts('vI:p:'); # -v Verbose diff --git a/t/lib/dumper-ovl.t b/t/lib/dumper-ovl.t index 8c095e5..b8c8719 100755 --- a/t/lib/dumper-ovl.t +++ b/t/lib/dumper-ovl.t @@ -3,6 +3,11 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib' if -d '../lib'; + require Config; import Config; + if ($Config{'extensions'} !~ /\bData\/Dumper\b/) { + print "1..0 # Skip: Data::Dumper was not built\n"; + exit 0; + } } use Data::Dumper; diff --git a/t/lib/dumper.t b/t/lib/dumper.t index b9680bd..7b5a611 100755 --- a/t/lib/dumper.t +++ b/t/lib/dumper.t @@ -6,6 +6,11 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib' if -d '../lib'; + require Config; import Config; + if ($Config{'extensions'} !~ /\bData\/Dumper\b/) { + print "1..0 # Skip: Data::Dumper was not built\n"; + exit 0; + } } use Data::Dumper; diff --git a/t/lib/hostname.t b/t/lib/hostname.t index 6f61fb9..8a34e9c 100755 --- a/t/lib/hostname.t +++ b/t/lib/hostname.t @@ -3,6 +3,11 @@ BEGIN { chdir 't' if -d 't'; unshift @INC, '../lib'; + require Config; import Config; + if ($Config{'extensions'} !~ /\bSys\/Hostname\b/) { + print "1..0 # Skip: Sys::Hostname was not built\n"; + exit 0; + } } use Sys::Hostname; diff --git a/t/lib/ipc_sysv.t b/t/lib/ipc_sysv.t index a4f3e3f..d2991e3 100755 --- a/t/lib/ipc_sysv.t +++ b/t/lib/ipc_sysv.t @@ -9,7 +9,9 @@ BEGIN { my $reason; - if ($Config{'d_sem'} ne 'define') { + if ($Config{'extensions'} !~ /\bIPC\/SysV\b/) { + $reason = 'IPC::SysV was not built'; + } elsif ($Config{'d_sem'} ne 'define') { $reason = '$Config{d_sem} undefined'; } elsif ($Config{'d_msg'} ne 'define') { $reason = '$Config{d_msg} undefined'; diff --git a/t/op/taint.t b/t/op/taint.t index 6548b46..af57834 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -24,7 +24,8 @@ BEGIN { $ENV{PATH} = $ENV{PATH}; $ENV{TERM} = $ENV{TERM} ne ''? $ENV{TERM} : 'dummy'; } - if ($Config{d_shm} || $Config{d_msg}) { + if ($Config{'extensions'} =~ /\bIPC\/SysV\b/ + && ($Config{d_shm} || $Config{d_msg})) { require IPC::SysV; IPC::SysV->import(qw(IPC_PRIVATE IPC_RMID IPC_CREAT S_IRWXU)); } @@ -612,7 +613,7 @@ else { # test shmread { - if ($Config{d_shm}) { + if ($Config{'extensions'} =~ /\bIPC\/SysV\b/ && $Config{d_shm}) { no strict 'subs'; my $sent = "foobar"; my $rcvd; @@ -646,7 +647,7 @@ else { # test msgrcv { - if ($Config{d_msg}) { + if ($Config{'extensions'} =~ /\bIPC\/SysV\b/ && $Config{d_msg}) { no strict 'subs'; my $id = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU);