diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 55dd91b..0e00325 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -1,63 +1,63 @@ #!/bin/bash ######################################################################### function test_output { - name=$( basename -s .verified $1 ) + name=$( basename $1 .verified ) echo "Testing $name ouput" echo -n "------------ " diff $name.out $name.verified >/dev/null 2>&1 return $? } ######################################################################### function test_return { - name=$( basename -s .py $1 ) + name=$( basename $1 .py ) echo "Testing $name.py" echo -n "------------ " PYTHONPATH=../python python $name.py 2>/dev/null > $name.out return $? } ######################################################################### tamaas_path=$(PYTHONPATH=../python python -c 'import tamaas; print tamaas' | cut -d "'" -f 4 ) echo "Tamaas test suite" echo "=================" echo "" echo "importing tamaas from $tamaas_path" echo "" n_tests=0 passed_tests=0 for test_file in test_*.py; do ((n_tests++)) test_return $test_file result=$? if [ $result -ne 0 ]; then echo "failure" else echo "success" ((passed_tests++)) fi done for test_file in test_*.verified; do ((n_tests++)) test_output $test_file result=$? if [ $result -ne 0 ]; then echo "failure" else echo "success" ((passed_tests++)) fi done failed_tests=$((n_tests - passed_tests)) echo "" echo "Test results :" echo " - passed $passed_tests/$n_tests" echo " - failed $failed_tests/$n_tests"