diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-03-06 21:58:19 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-03-06 22:48:16 +0000 |
commit | 7465bc322e5c5dcbd256bb5fbdd3135163fb3dc1 (patch) | |
tree | 03dcd93e4a3ae2b625c5c44c07419cc159d2ba45 /t/test.pl | |
parent | 21da8bce185d89ceb57f48bde4bcb5679ce4d106 (diff) | |
download | perl-7465bc322e5c5dcbd256bb5fbdd3135163fb3dc1.tar.gz |
Add skip_all_without_extension() to test.pl, for the common skip idiom.
Use it in t/io/layers.t to skip if Encode is not built.
Diffstat (limited to 't/test.pl')
-rw-r--r-- | t/test.pl | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -122,6 +122,16 @@ sub skip_all_if_miniperl { skip_all(@_) if is_miniperl(); } +sub skip_all_without_extension { + my $extension = shift; + unless (eval 'require Config; 1') { + warn "test.pl had problems loading Config: $@"; + return; + } + return if ($Config::Config{extensions} =~ /\b$extension\b/); + skip_all("$extension was not built"); +} + sub _ok { my ($pass, $where, $name, @mess) = @_; # Do not try to microoptimize by factoring out the "not ". |