diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-03-07 19:25:13 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-03-07 19:25:13 +0000 |
commit | 9c8416b2f966e2868aea89c8c24ff2774a4c6d75 (patch) | |
tree | bd05f2c6525d53ea3954c207f9e4870cf21fce0d /t/run | |
parent | 991b87804e286479de011fbef06fb073174aed77 (diff) | |
download | perl-9c8416b2f966e2868aea89c8c24ff2774a4c6d75.tar.gz |
Add skip_all_without_config() to test.pl, and use it in 6 tests.
This abstracts out the common idiom of loading Config, checking if a particular
key is true, and if not implementing a "skip all" with an appropriate reason.
Diffstat (limited to 't/run')
-rw-r--r-- | t/run/cloexec.t | 6 | ||||
-rw-r--r-- | t/run/runenv.t | 7 |
2 files changed, 3 insertions, 10 deletions
diff --git a/t/run/cloexec.t b/t/run/cloexec.t index 314d5fa572..486df1eaad 100644 --- a/t/run/cloexec.t +++ b/t/run/cloexec.t @@ -35,12 +35,8 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; - if (!$Config::Config{'d_fcntl'}) { - print("1..0 # Skip: fcntl() is not available\n"); - exit(0); - } require './test.pl'; + skip_all_without_config('d_fcntl'); } use strict; diff --git a/t/run/runenv.t b/t/run/runenv.t index b3e47a6e17..cea2590414 100644 --- a/t/run/runenv.t +++ b/t/run/runenv.t @@ -8,11 +8,8 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require Config; import Config; - unless ($Config{'d_fork'}) { - print "1..0 # Skip: no fork\n"; - exit 0; - } - require './test.pl' + require './test.pl'; + skip_all_without_config('d_fork'); } plan tests => 84; |