3 bp=`basename $0 | sed s/^test_//`
4 in="$BP_DIR/bp_test/in/$bp.in"
5 out="$BP_DIR/bp_test/out/$bp.out"
7 tmp_dir="$BP_TMP/test_tmp"
8 log_file="$BP_TMP/$USER.test.log"
14 msg="${command/$BP_DIR/\$BP_DIR}"
15 msg="${msg//$BP_TMP/\$BP_TMP}"
17 echo -n "Testing $msg ... "
18 eval $command > /dev/null 2>&1
25 eval $command > /dev/null 2>&1
28 function assert_no_diff
33 if [ ! -f $src ]; then
39 if [ ! -f $dst ]; then
45 local diff=`diff -q $src $dst`
47 if [ "$diff" != "" ]; then
56 function assert_files_exists
61 if [ ! -f $arg ]; then
66 if [ $error = 1 ]; then
79 echo "$msg" >> $log_file
86 echo -e "\033[32;38m$msg\033[0m"
93 echo -e "\033[33;38m$msg\033[0m"
100 echo -e "\033[31;38m$msg\033[0m"
105 if [ -f "$tmp" ]; then
112 echo -n "Testing Perl version ... "
114 if error=$( perl -e 'use 5.8.0;' 2>&1 ); then
118 echo $error | sed "s/, stopped.*//"
124 function test_perl_module
128 echo -n "Testing required Perl module - \"$module\": "
130 if ! error=$( perl -M$module -e '' 2>&1 > /dev/null ); then
132 echo " Try: perl -MCPAN -e 'install $module'"
142 echo -n "Testing Ruby version ... "
144 if error=$( ruby -e 'raise "Ruby version 1.9 required--this is only #{RUBY_VERSION}" if RUBY_VERSION < "1.9"' 2>&1 ); then
148 echo $error | sed "s/.*: //"
154 function test_ruby_gem
158 echo -n "Testing required Ruby gem - \"$gem\": "
160 if error=$( gem list --local | grep $gem ); then
165 echo " Try: gem install $gem"
170 function test_aux_program
174 echo -n "Testing auxiliary program - \"$program\": "
176 if command -v $program >/dev/null; then
180 echo_yellow "WARNING"