From: Jesse Luehrs Date: Tue, 18 Dec 2012 21:06:01 +0000 (-0600) Subject: skip this test if we can't get an absolute path X-Git-Tag: upstream/5.20.0~4406 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e0a4ea0a22a75d20fa253f09e58851391a17283;p=platform%2Fupstream%2Fperl.git skip this test if we can't get an absolute path fixes testing as root on at least solaris and openbsd --- diff --git a/t/op/require_errors.t b/t/op/require_errors.t index c60bc7d..e323948 100644 --- a/t/op/require_errors.t +++ b/t/op/require_errors.t @@ -89,13 +89,18 @@ SKIP: { qr<^\QCan't locate $mod_file:>, "special error message if the file exists but can't be opened"; - my $file = File::Spec::Functions::catfile(Cwd::getcwd(), $mod_file); - eval { - require($file); - }; - like $@, - qr<^\QCan't locate $file:>, - "...even if we use a full path"; + SKIP: { + skip "Can't make the path absolute", 1 + if !defined(Cwd::getcwd()); + + my $file = File::Spec::Functions::catfile(Cwd::getcwd(), $mod_file); + eval { + require($file); + }; + like $@, + qr<^\QCan't locate $file:>, + "...even if we use a full path"; + } # switch uid back (may not be implemented) eval { $> = $olduid; };