#!/bin/sh build_dir=`pwd` # This script tests that incorrect syntax on various commands produces the # appropriate error messages set -e RESULT=pass #for x in `cd $srcdir; echo *.stat *.data`; do # if [ ! -e $x ]; then # ln -s $srcdir/$x . # fi #done rm -f *.actual if [ -z "$BENCHMARK" ]; then for t in $top_srcdir/tests/*.stat; do x=`basename $t` echo -n "$x ... " # if [ $x = bignum.stat ] ; then continue ; fi # if [ $x = data-list.stat ] ; then continue ; fi # if [ $x = do-repeat.stat ] ; then continue ; fi # if [ $x = list.stat ] ; then continue ; fi # if [ $x = print.stat ] ; then continue ; fi # if [ $x = reread.stat ] ; then continue ; fi # if [ $x = weighting.stat ] ; then continue ; fi cat $t | ../src/pspp -B $top_srcdir/config --testing-mode - > $build_dir/$x.actual if [ -f $top_srcdir/tests/expect/$x ]; then if diff -u $top_srcdir/tests/expect/$x $build_dir/$x.actual; then echo "pass"; rm $build_dir/$x.actual else echo "FAIL"; RESULT=fail ; exit 1 fi else if [ -s $build_dir/$x.actual ]; then diff -u /dev/null $build_dir/$x.actual || true echo "FAIL"; RESULT=fail ; exit 1 else echo "pass"; rm $build_dir/$x.actual fi fi done else mkdir $build_dir/benchmark || true rm -f $build_dir/benchmark/* for x in $top_srcdir/tests/*.stat; do echo -n "$x ... " ../src/pspp -B $top_srcdir/config --testing-mode $x > $build_dir/benchmark/$x if [ ! -s $build_dirbenchmark/$x ]; then rm $build_dir/benchmark/$x fi echo done fi # for x in *.stat *.data; do # if [ -h $x ]; then # rm $x # fi #done if [ $RESULT = fail ]; then exit 1; fi