diff options
author | Jerry D. Hedden <jdhedden@cpan.org> | 2007-04-04 05:57:16 -0400 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-04-06 14:15:44 +0000 |
commit | 494364e0465f3123bb285c25f7aea65e01c763c4 (patch) | |
tree | 21200e749d049d5efd435e1564e55cd13ec14743 /ext/DynaLoader | |
parent | 53ae2428795d0b9d42a1657c22c5f1b557784379 (diff) | |
download | perl-494364e0465f3123bb285c25f7aea65e01c763c4.tar.gz |
Allow any *DBM_File to work for DynaLoader testing
From: "Jerry D. Hedden" <jdhedden@1979.usna.com>
Message-ID: <1ff86f510704040657t732af552jbcbdb8804d134ff7@mail.gmail.com>
p4raw-id: //depot/perl@30852
Diffstat (limited to 'ext/DynaLoader')
-rw-r--r-- | ext/DynaLoader/t/DynaLoader.t | 13 | ||||
-rw-r--r-- | ext/DynaLoader/t/XSLoader.t | 11 |
2 files changed, 22 insertions, 2 deletions
diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t index 619887cb1f..3d74bc795a 100644 --- a/ext/DynaLoader/t/DynaLoader.t +++ b/ext/DynaLoader/t/DynaLoader.t @@ -12,11 +12,22 @@ use Config; use Test::More; my %modules; +my $db_file; +BEGIN { + use Config; + foreach (qw/SDBM_File GDBM_File ODBM_File NDBM_File DB_File/) { + if ($Config{extensions} =~ /\b$_\b/) { + $db_file = $_; + last; + } + } +} + %modules = ( # ModuleName => q| code to check that it was loaded |, 'Cwd' => q| ::is( ref Cwd->can('fastcwd'),'CODE' ) |, # 5.7 ? 'File::Glob' => q| ::is( ref File::Glob->can('doglob'),'CODE' ) |, # 5.6 - 'SDBM_File' => q| ::is( ref SDBM_File->can('TIEHASH'), 'CODE' ) |, # 5.0 + $db_file => q| ::is( ref $db_file->can('TIEHASH'), 'CODE' ) |, # 5.0 'Socket' => q| ::is( ref Socket->can('inet_aton'),'CODE' ) |, # 5.0 'Time::HiRes'=> q| ::is( ref Time::HiRes->can('usleep'),'CODE' ) |, # 5.7.3 ); diff --git a/ext/DynaLoader/t/XSLoader.t b/ext/DynaLoader/t/XSLoader.t index 82dca56dff..e35c4eea4a 100644 --- a/ext/DynaLoader/t/XSLoader.t +++ b/ext/DynaLoader/t/XSLoader.t @@ -10,12 +10,21 @@ BEGIN { use strict; use Config; +my $db_file; BEGIN { eval "use Test::More"; if ($@) { print "1..0 # Skip: Test::More not available\n"; die "Test::More not available\n"; } + + use Config; + foreach (qw/SDBM_File GDBM_File ODBM_File NDBM_File DB_File/) { + if ($Config{extensions} =~ /\b$_\b/) { + $db_file = $_; + last; + } + } } @@ -23,7 +32,7 @@ my %modules = ( # ModuleName => q|code to check that it was loaded|, 'Cwd' => q| ::can_ok( 'Cwd' => 'fastcwd' ) |, # 5.7 ? 'File::Glob' => q| ::can_ok( 'File::Glob' => 'doglob' ) |, # 5.6 - 'SDBM_File' => q| ::can_ok( 'SDBM_File' => 'TIEHASH' ) |, # 5.0 + $db_file => q| ::can_ok( $db_file => 'TIEHASH' ) |, # 5.0 'Socket' => q| ::can_ok( 'Socket' => 'inet_aton' ) |, # 5.0 'Time::HiRes'=> q| ::can_ok( 'Time::HiRes' => 'usleep' ) |, # 5.7.3 ); |