Fixed intl/ and some tests, so that the project can be built and tested
[pspp-builds.git] / tests / syntax
1 #!/bin/sh
2
3 build_dir=`pwd`
4
5
6 # This script tests that incorrect syntax on various commands produces the 
7 # appropriate error messages
8
9 set -e
10 RESULT=pass
11
12
13 #for x in `cd $srcdir; echo *.stat *.data`; do 
14 #    if [ ! -e $x ]; then
15 #       ln -s $srcdir/$x .
16 #    fi
17 #done
18
19 rm -f *.actual
20 if [ -z "$BENCHMARK" ]; then
21     for t in $top_srcdir/tests/*.stat; do
22         x=`basename $t`
23         echo -n "$x ... "
24 #       if [ $x = bignum.stat ] ; then continue ; fi
25 #       if [ $x = data-list.stat ] ; then continue ; fi
26 #       if [ $x = do-repeat.stat ] ; then continue ; fi
27 #       if [ $x = list.stat ] ; then continue ; fi
28 #       if [ $x = print.stat ] ; then continue ; fi
29 #       if [ $x = reread.stat ] ; then continue ; fi
30 #       if [ $x = weighting.stat ] ; then continue ; fi
31         cat $t | ../src/pspp -B $top_srcdir/config --testing-mode - > $build_dir/$x.actual 
32         if [ -f $top_srcdir/tests/expect/$x ]; then
33             if diff -u $top_srcdir/tests/expect/$x $build_dir/$x.actual; then 
34                 echo "pass"; rm $build_dir/$x.actual
35             else 
36                 echo "FAIL"; RESULT=fail ; exit 1
37             fi
38         else
39             if [ -s $build_dir/$x.actual ]; then 
40                 diff -u /dev/null $build_dir/$x.actual || true
41                 echo "FAIL"; RESULT=fail ; exit 1
42             else 
43                 echo "pass"; rm $build_dir/$x.actual
44             fi
45         fi
46     done
47 else
48     mkdir $build_dir/benchmark || true
49     rm -f $build_dir/benchmark/*
50     for x in $top_srcdir/tests/*.stat; do
51         echo -n "$x ... "
52         ../src/pspp -B $top_srcdir/config --testing-mode $x > $build_dir/benchmark/$x
53         if [ ! -s $build_dirbenchmark/$x ]; then
54             rm $build_dir/benchmark/$x
55         fi
56         echo
57     done
58 fi
59
60 # for x in *.stat *.data; do
61 #   if [ -h $x ]; then
62 #       rm $x
63 #    fi
64 #done
65
66 if [ $RESULT = fail ]; then exit 1; fi
67