From: Florian Ragwitz Date: Wed, 24 Dec 2008 14:30:25 +0000 (+0000) Subject: Make the test suites YAML dependency optional. X-Git-Tag: 5.8000_05~80 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15f0ede8ee33bc9b0c002221a8e62f59e8b7b7e2;p=catagits%2FCatalyst-Runtime.git Make the test suites YAML dependency optional. --- diff --git a/t/lib/TestApp/Controller/Fork.pm b/t/lib/TestApp/Controller/Fork.pm index 648b2fb..086d149 100644 --- a/t/lib/TestApp/Controller/Fork.pm +++ b/t/lib/TestApp/Controller/Fork.pm @@ -7,7 +7,8 @@ package TestApp::Controller::Fork; use strict; use warnings; use base 'Catalyst::Controller'; -use YAML; + +eval 'use YAML'; sub system : Local { my ($self, $c, $ls) = @_; diff --git a/t/live_fork.t b/t/live_fork.t index bd7054e..3abe4e2 100644 --- a/t/live_fork.t +++ b/t/live_fork.t @@ -10,11 +10,13 @@ Tests if Catalyst can fork/exec other processes successfully use strict; use warnings; use Test::More; -use YAML; use FindBin; use lib "$FindBin::Bin/lib"; use Catalyst::Test qw(TestApp); +eval 'use YAML'; +plan skip_all => 'YAML required' if $@; + plan skip_all => 'Using remote server' if $ENV{CATALYST_SERVER}; diff --git a/t/optional_memleak.t b/t/optional_memleak.t index 391f031..b454451 100644 --- a/t/optional_memleak.t +++ b/t/optional_memleak.t @@ -8,16 +8,19 @@ use lib "$FindBin::Bin/lib"; use Test::More; use Catalyst::Test 'TestApp'; -use YAML; -eval "use Proc::ProcessTable"; plan skip_all => 'set TEST_MEMLEAK to enable this test' unless $ENV{TEST_MEMLEAK}; + +eval "use Proc::ProcessTable"; plan skip_all => 'Proc::ProcessTable required for this test' if $@; eval "use HTTP::Body 0.03"; plan skip_all => 'HTTP::Body >= 0.03 required for this test' if $@; +eval "use YAML"; +plan skip_all => 'YAML required for this test' if $@; + our $t = Proc::ProcessTable->new( cache_ttys => 1 ); our ( $initial, $final ) = ( 0, 0 ); our $tests = YAML::LoadFile("$FindBin::Bin/optional_stress.yml"); diff --git a/t/optional_stress.t b/t/optional_stress.t index eed111a..c0f2597 100644 --- a/t/optional_stress.t +++ b/t/optional_stress.t @@ -8,7 +8,6 @@ use lib "$FindBin::Bin/lib"; use Test::More; use Catalyst::Test 'TestApp'; -use YAML; our ( $iters, $tests ); @@ -16,6 +15,9 @@ BEGIN { plan skip_all => 'set TEST_STRESS to enable this test' unless $ENV{TEST_STRESS}; + eval "use YAML"; + plan skip_all => 'YAML is required for this test' if $@; + $iters = $ENV{TEST_STRESS} || 10; $tests = YAML::LoadFile("$FindBin::Bin/optional_stress.yml");