#!/bin/sh if [ "$1" = "-val" ] then shift [ ! -d .valgrind ] && mkdir .valgrind rm -f .valgrind/log* PROG=./trun_vallog else PROG=../bin/spftest/spftest_static fi DATA=test_adopt_roll.txt echo echo "Testing byte-compiler on SPF Adoption Roll data" echo "Prog = $PROG" echo "Data = $DATA" perl test_parser.pl -impl libspf-alt -program $PROG -data $DATA 2>&1 \ | grep -v "^ok [0-9][0-9]*" | tee tests_parser.out num_todo=`grep "^# Test [0-9][0-9]* got:" tests_parser.out | grep "\*TODO\*)" | wc -l` num_todo=`expr $num_todo + 0` if [ $num_todo -ne 0 ] then echo "Note: tests that failed, but are marked with \"*TODO*\" are ok" fi num_errors=`grep "^# Test [0-9][0-9]* got:" tests_parser.out | grep -v "\*TODO\*)" | wc -l` num_errors=`expr $num_errors + 0` if [ $num_errors -ne 0 ] then echo "Error: $num_errors tests failed" else echo "All regression tests passed" fi if [ "$1" = "-val" ] then sleep 1 grep -n "== ERROR SUMMARY: " .valgrind/log* | grep -v "0 errors from 0 contexts" | head fi [ $num_errors -ne 0 ] && exit 1 exit 0