3 # This program tests the DO IF command.
5 TEMPDIR=/tmp/pspp-tst-$$
7 # ensure that top_builddir are absolute
8 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
9 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
10 top_builddir=`cd $top_builddir; pwd`
11 PSPP=$top_builddir/src/ui/terminal/pspp
13 # ensure that top_srcdir is absolute
14 top_srcdir=`cd $top_srcdir; pwd`
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
56 activity="generate input and expected output"
63 if test "$a" = "1"; then
65 elif test "$a" = " "; then
67 elif test "$b" = "1"; then
69 elif test "$b" = " "; then
71 elif test "$c" = "1"; then
73 elif test "$c" = " "; then
75 elif test "$d" = "1"; then
77 elif test "$d" = " "; then
85 done) >test1.expected 3>test1.data
86 if [ $? -ne 0 ] ; then no_result ; fi
88 activity="create test1.pspp"
89 cat > test1.pspp <<EOF
90 DATA LIST FILE="test1.data"/A B C D 1-4 ABCD 1-4 (A).
92 PRINT OUTFILE="test1.out"/ABCD 'A'.
94 PRINT OUTFILE="test1.out"/ABCD 'B'.
96 PRINT OUTFILE="test1.out"/ABCD 'C'.
98 PRINT OUTFILE="test1.out"/ABCD 'D'.
100 PRINT OUTFILE="test1.out"/ABCD 'E'.
104 if [ $? -ne 0 ] ; then no_result ; fi
107 $SUPERVISOR $PSPP --testing-mode test1.pspp
108 if [ $? -ne 0 ] ; then no_result ; fi
110 activity="compare test1 results"
111 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
112 diff -u $TEMPDIR/test1.out $TEMPDIR/test1.expected
113 if [ $? -ne 0 ] ; then fail ; fi