3 # This program tests the flip command
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_builddir are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
57 activity="create flip.stat"
58 cat > $TEMPDIR/flip.stat <<EOF
59 data list /N 1 (a) A B C D 2-9.
73 if [ $? -ne 0 ] ; then no_result ; fi
76 activity="run program"
77 $SUPERVISOR $PSPP -o raw-ascii $TEMPDIR/flip.stat
78 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="compare output"
81 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
82 diff -b $TEMPDIR/pspp.list - << EOF
83 1.1 DATA LIST. Reading 1 record from INLINE.
84 +--------+------+-------+------+
85 |Variable|Record|Columns|Format|
86 #========#======#=======#======#
92 +--------+------+-------+------+
101 -------- -------- -------- -------- -------- --------
102 A 1.00 6.00 11.00 16.00 21.00
103 B 2.00 7.00 12.00 17.00 22.00
104 C 3.00 8.00 13.00 18.00 23.00
105 D 4.00 9.00 14.00 19.00 24.00
107 -------- -------- -------- -------- --------
108 V 1.00 2.00 3.00 4.00
109 W 6.00 7.00 8.00 9.00
110 X 11.00 12.00 13.00 14.00
111 Y 16.00 17.00 18.00 19.00
112 Z 21.00 22.00 23.00 24.00
114 if [ $? -ne 0 ] ; then fail ; fi