From 990f31c19579d17a5d3550e721d1ba36f0ef54d3 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 30 May 2011 08:37:00 +0000 Subject: [PATCH] added perl module and ruby gem test to bp_test git-svn-id: http://biopieces.googlecode.com/svn/trunk@1442 74ccb610-7750-0410-82ae-013aeee3265d --- bp_test/lib/test.sh | 33 ++++++++++++++++++++++++++++++++- bp_test/test_all | 7 +++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/bp_test/lib/test.sh b/bp_test/lib/test.sh index 68b83de..cabff69 100755 --- a/bp_test/lib/test.sh +++ b/bp_test/lib/test.sh @@ -117,11 +117,26 @@ function test_perl fi } +function test_perl_module +{ + local module=$1 + + echo -n "Checking required Perl module - \"$module\": " + + if ! error=$( perl -M$module -e '' 2>&1 > /dev/null ); then + echo_red "FAIL" + echo " Try: perl -MCPAN -e 'install $module'" + exit + else + echo_green "OK" + fi +} + function test_ruby { echo -n "Testing Ruby version ... " - if error=$( ruby -e 'raise "Ruby version 1.9 reqauired--this is only #{RUBY_VERSION}" if RUBY_VERSION < "1.9"' 2>&1 ); then + if error=$( ruby -e 'raise "Ruby version 1.9 required--this is only #{RUBY_VERSION}" if RUBY_VERSION < "1.9"' 2>&1 ); then echo_green "OK" else echo $error | sed "s/.*: //" @@ -129,3 +144,19 @@ function test_ruby exit fi } + +function test_ruby_gem +{ + local gem=$1 + + echo -n "Checking required Ruby gem - \"$gem\": " + + if error=$( gem list --local | grep $gem ); then + echo_green "OK" + else + echo_red "FAIL" + echo " Try: gem install $gem" + exit + fi +} + diff --git a/bp_test/test_all b/bp_test/test_all index 397db6a..9348649 100755 --- a/bp_test/test_all +++ b/bp_test/test_all @@ -7,7 +7,14 @@ if [ -f $log_file ]; then fi test_perl +test_perl_module "Inline" +test_perl_module "JSON::XS" +test_perl_module "SVG" +test_perl_module "Bit::Vector" +test_perl_module "Time::HiRes" test_ruby +test_ruby_gem "gnuplot" +test_ruby_gem "narray" count=0 time0=`date +%s` -- 2.39.5