]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_test/lib/test.sh
added version test of perl and ruby
[biopieces.git] / bp_test / lib / test.sh
index fd2566d0c029e0f9d1d1189b39b8792f0bd037de..5d33f1db33710ef3f6303db70bbf619c082c55fd 100755 (executable)
@@ -96,3 +96,29 @@ function clean
         rm "$tmp"
     fi
 }
+
+function test_perl
+{
+    echo -n "Testing Perl version ... "
+
+    if error=$( perl -e 'use 5.8.0;' 2>&1 ); then
+        echo_green "OK"
+    else
+        echo $error | sed "s/, stopped.*//"
+        echo_red "FAIL"
+        exit
+    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
+        echo_green "OK"
+    else
+        echo $error | sed "s/.*: //"
+        echo_red "FAIL"
+        exit
+    fi  
+}