summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2006-05-25 15:20:53 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-05-26 13:01:35 +0000
commitc3026122df2ea8c3b01e4d1278d0519e50eeab9a (patch)
tree8319320122dd48af42cde7dced5d6a9954cbbe93 /ext
parent0c96388fb9e802edf81ea88509a54738dad9a335 (diff)
downloadperl-c3026122df2ea8c3b01e4d1278d0519e50eeab9a.tar.gz
Re: [PATCH] Test script for DynaLoader
Message-ID: <9b18b3110605250420m7431bfbeve44aada2025264f7@mail.gmail.com> p4raw-id: //depot/perl@28308
Diffstat (limited to 'ext')
-rw-r--r--ext/DynaLoader/t/DynaLoader.t30
1 files changed, 21 insertions, 9 deletions
diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t
index 841fa225db..23af85208d 100644
--- a/ext/DynaLoader/t/DynaLoader.t
+++ b/ext/DynaLoader/t/DynaLoader.t
@@ -65,17 +65,29 @@ like( $@, q{/^Usage: DynaLoader::dl_load_file\(filename, flags=0\)/},
eval { no warnings 'uninitialized'; DynaLoader::dl_load_file(undef) };
is( $@, '', "calling DynaLoader::dl_load_file() with undefined argument" ); # is this expected ?
+my ($eint,$estr,$eestr,$dlerr);
eval { DynaLoader::dl_load_file("egg_bacon_sausage_and_spam") };
-is( $@, '', "calling DynaLoader::dl_load_file() with a package without binary object" );
-is( 0+$!, ENOENT, "checking errno value" );
-like( DynaLoader::dl_error(), "/$!/", "checking error message returned by dl_error()" );
+$eint = 0+$!; $estr = "\Q$!\E";
+$estr .= "|\Q$^E\E" if $^E ne $!;
+$estr = "/$estr/";
+$dlerr = DynaLoader::dl_error();
+SKIP: {
+ is( $@, '', "calling DynaLoader::dl_load_file() with a package without binary object" )
+ or skip "Errvalue irrelevent after eval failure (this should not happen)", 2;
+ is( $eint, ENOENT, "checking errno value" );
+ like( $dlerr, $estr, "checking error message returned by dl_error()" );
+}
-# ... dl_findfile()
-my @files = ();
-eval { @files = DynaLoader::dl_findfile("c") };
-is( $@, '', "calling dl_findfile()" );
-cmp_ok( scalar @files, '>=', 1, " - array should contain one result result or more: libc => (@files)" );
+# ... dl_findfile()
+SKIP: {
+ my @files = ();
+ eval { @files = DynaLoader::dl_findfile("c") };
+ is( $@, '', "calling dl_findfile()" );
+ skip "dl_findfile test not appropriate on Win32", 1
+ if $^O =~ /win32/i;
+ cmp_ok( scalar @files, '>=', 1, " - array should contain one result result or more: libc => (@files)" );
+}
# Now try to load well known XS modules
my $extensions = $Config{'extensions'};
@@ -83,7 +95,7 @@ $extensions =~ s|/|::|g;
for my $module (sort keys %modules) {
SKIP: {
- skip "$module not available", 2 if $extensions !~ /\b$module\b/;
+ skip "$module not available", 1 if $extensions !~ /\b$module\b/;
eval "use $module";
is( $@, '', "loading $module" );
}