From: Chris Marshall Date: Tue, 15 Jun 2010 01:22:57 +0000 (-0400) Subject: Conditionalize t/load_core.t for optional deps X-Git-Tag: v1.003015~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1b2a3182b4d150a6da7190b9d4ffa7318a9ad910;p=p5sagit%2FDevel-REPL.git Conditionalize t/load_core.t for optional deps Tests for various components are now skipped if the required dependency is not installed. --- diff --git a/t/load_core.t b/t/load_core.t index 945600b..77bd5dc 100755 --- a/t/load_core.t +++ b/t/load_core.t @@ -6,30 +6,78 @@ use_ok('Devel::REPL'); use_ok('Devel::REPL::Script'); use_ok('Devel::REPL::Plugin::Colors'); use_ok('Devel::REPL::Plugin::Commands'); -use_ok('Devel::REPL::Plugin::Completion'); + +eval 'use PPI'; +unless ($@) { + use_ok('Devel::REPL::Plugin::Completion'); +} + +eval 'use File::Next'; +unless ($@) { + use_ok('Devel::REPL::Plugin::CompletionDriver::INC'); +} + +eval 'use B::Keywords'; +unless ($@) { + use_ok('Devel::REPL::Plugin::CompletionDriver::Keywords'); +} + +eval 'use Lexical::Persistence'; +unless ($@) { + use_ok('Devel::REPL::Plugin::CompletionDriver::LexEnv'); +} + use_ok('Devel::REPL::Plugin::CompletionDriver::Globals'); -use_ok('Devel::REPL::Plugin::CompletionDriver::INC'); -use_ok('Devel::REPL::Plugin::CompletionDriver::Keywords'); -use_ok('Devel::REPL::Plugin::CompletionDriver::LexEnv'); use_ok('Devel::REPL::Plugin::CompletionDriver::Methods'); -use_ok('Devel::REPL::Plugin::DDC'); -use_ok('Devel::REPL::Plugin::DDS'); + +eval 'use Data::Dump::Concise'; +unless ($@) { + use_ok('Devel::REPL::Plugin::DDC'); +} + +eval 'use Data::Dump::Streamer'; +unless ($@) { + use_ok('Devel::REPL::Plugin::DDS'); +} + use_ok('Devel::REPL::Plugin::DumpHistory'); use_ok('Devel::REPL::Plugin::FancyPrompt'); use_ok('Devel::REPL::Plugin::FindVariable'); use_ok('Devel::REPL::Plugin::History'); -# Interrupt depends on Sys::SigAction which -# is not available on win32 so we skip the -# test there -use_ok('Devel::REPL::Plugin::Interrupt') unless $^O eq 'MSWin32'; + +eval 'use Sys::SigAction'; +unless ($@) { + use_ok('Devel::REPL::Plugin::Interrupt'); +} + +# use_ok('Devel::REPL::Plugin::Interrupt') unless $^O eq 'MSWin32'; use_ok('Devel::REPL::Plugin::LexEnv'); -use_ok('Devel::REPL::Plugin::Nopaste'); + +eval 'use PPI'; +unless ($@) { + use_ok('Devel::REPL::Plugin::MultiLine::PPI'); +} + +eval 'use App::Nopaste'; +unless ($@) { + use_ok('Devel::REPL::Plugin::Nopaste'); +} + use_ok('Devel::REPL::Plugin::OutputCache'); -use_ok('Devel::REPL::Plugin::PPI'); use_ok('Devel::REPL::Plugin::Packages'); use_ok('Devel::REPL::Plugin::Peek'); +eval 'use PPI'; +unless ($@) { + use_ok('Devel::REPL::Plugin::PPI'); +} + use_ok('Devel::REPL::Plugin::ReadLineHistory'); -use_ok('Devel::REPL::Plugin::Refresh'); + +eval 'use Module::Refresh'; +unless ($@) { + use_ok('Devel::REPL::Plugin::Refresh'); +} + use_ok('Devel::REPL::Plugin::ShowClass'); use_ok('Devel::REPL::Plugin::Timing'); use_ok('Devel::REPL::Plugin::Turtles');