]> git.donarmstrong.com Git - biopieces.git/commitdiff
added warnings to bp_test
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Sun, 3 Jul 2011 18:38:37 +0000 (18:38 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Sun, 3 Jul 2011 18:38:37 +0000 (18:38 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1483 74ccb610-7750-0410-82ae-013aeee3265d

bp_test/lib/test.sh
bp_test/test_all

index 18ee4c342117c8fd919d094b9bfcac4d212165cc..768388b6e6334bed5b60d35b6c023a108acf0f59 100755 (executable)
@@ -113,6 +113,7 @@ function test_perl
 
     if error=$( perl -e 'use 5.8.0;' 2>&1 ); then
         echo_green "OK"
+        log "OK"
     else
         echo $error | sed "s/, stopped.*//"
         echo_red "FAIL"
@@ -132,6 +133,7 @@ function test_perl_module
         exit
     else
         echo_green "OK"
+        log "OK"
     fi
 }
 
@@ -141,6 +143,7 @@ function test_ruby
 
     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"
+        log "OK"
     else
         echo $error | sed "s/.*: //"
         echo_red "FAIL"
@@ -156,6 +159,7 @@ function test_ruby_gem
 
     if error=$( gem list --local | grep $gem ); then
         echo_green "OK"
+        log "OK"
     else
         echo_red "FAIL"
         echo "   Try: gem install $gem"
@@ -163,3 +167,17 @@ function test_ruby_gem
     fi
 }
 
+function test_aux_program
+{
+    local program=$1
+
+    echo -n "Checking auxillary program - \"$program\": "
+
+    if command -v $program >/dev/null; then
+        echo_green "OK"
+        log "OK"
+    else
+        echo_yellow "WARNING"
+        log "WARNING"
+    fi
+}
index 93486494ddcd8f4c2d7b28ffc81dd0d2182c6e74..c54f093ca4599bde63e83c13271e4af1572a491c 100755 (executable)
@@ -15,6 +15,23 @@ test_perl_module "Time::HiRes"
 test_ruby
 test_ruby_gem "gnuplot"
 test_ruby_gem "narray"
+test_aux_program "blastall"
+test_aux_program "blat"
+test_aux_program "bwa"
+test_aux_program "bowtie"
+test_aux_program "formatdb"
+test_aux_program "gnuplot"
+test_aux_program "idba"
+test_aux_program "muscle"
+test_aux_program "mummer"
+test_aux_program "mysql"
+test_aux_program "prodigal"
+test_aux_program "ray"
+test_aux_program "scan_for_matches"
+test_aux_program "uclust"
+test_aux_program "velveth"
+test_aux_program "velvetg"
+test_aux_program "vmatch"
 
 count=0
 time0=`date +%s`
@@ -29,13 +46,15 @@ time=$[ $time1 - $time0 ]
 
 test_count=`cat $log_file | wc -l | sed "s/ //g"`
 test_ok=`grep -c "OK" $log_file`
+test_fail=`grep -c "FAIL" $log_file`
+test_warn=`grep -c "WARNING" $log_file`
 
-test_fail=$[ $test_count - $test_ok ]
+report="Biopieces tested: $count  Tests run: $test_count  OK: $test_ok  FAIL: $test_fail  WARNING: $test_warn  Time: $time secs"
 
-report="Biopieces tested: $count   Tests run: $test_count   OK: $test_ok   FAIL: $test_fail   Time: $time secs"
-
-if [ $test_fail = 0 ]; then
-    echo_green "$report"
-else
+if (($test_fail > 0)); then
     echo_red "$report"
+elif (($test_warn > 0)); then
+    echo_yellow "$report"
+else
+    echo_green "$report"
 fi