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/test.log"
14 echo -n "Testing $command ... "
15 eval $command > /dev/null 2>&1
22 eval $command > /dev/null 2>&1
25 function assert_no_diff
30 if [ ! -f $src ]; then
36 if [ ! -f $dst ]; then
42 local diff=`diff -q $src $dst`
44 if [ "$diff" != "" ]; then
53 function assert_files_exists
58 if [ ! -f $arg ]; then
63 if [ $error = 1 ]; then
76 echo "$msg" >> $log_file
83 echo -e "\033[32;38m$msg\033[0m"
90 echo -e "\033[33;38m$msg\033[0m"
97 echo -e "\033[31;38m$msg\033[0m"
102 if [ -f "$tmp" ]; then
109 echo -n "Testing Perl version ... "
111 if error=$( perl -e 'use 5.8.0;' 2>&1 ); then
114 echo $error | sed "s/, stopped.*//"
120 function test_perl_module
124 echo -n "Checking required Perl module - \"$module\": "
126 if ! error=$( perl -M$module -e '' 2>&1 > /dev/null ); then
128 echo " Try: perl -MCPAN -e 'install $module'"
137 echo -n "Testing Ruby version ... "
139 if error=$( ruby -e 'raise "Ruby version 1.9 required--this is only #{RUBY_VERSION}" if RUBY_VERSION < "1.9"' 2>&1 ); then
142 echo $error | sed "s/.*: //"
148 function test_ruby_gem
152 echo -n "Checking required Ruby gem - \"$gem\": "
154 if error=$( gem list --local | grep $gem ); then
158 echo " Try: gem install $gem"