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
25 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
26 echo "NOT cleaning $TEMPDIR"
61 activity="create flip.stat"
62 cat > $TEMPDIR/flip.stat <<EOF
63 * Test FLIP with NEWNAME or, equivalently, with a variable named CASE_LBL.
64 data list notable /N 1 (a) A B C D 2-9.
78 * Test FLIP without NEWNAME.
79 data list list notable /v1 to v10.
83 4 5 6 7 8 9 10 11 12 13
91 if [ $? -ne 0 ] ; then no_result ; fi
94 activity="run program"
95 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/flip.stat
96 if [ $? -ne 0 ] ; then no_result ; fi
98 activity="compare output"
99 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
100 diff -b $TEMPDIR/pspp.list - << EOF
109 -------- -------- -------- -------- -------- --------
110 A 1.00 6.00 11.00 16.00 21.00
111 B 2.00 7.00 12.00 17.00 22.00
112 C 3.00 8.00 13.00 18.00 23.00
113 D 4.00 9.00 14.00 19.00 24.00
115 -------- -------- -------- -------- --------
116 V 1.00 2.00 3.00 4.00
117 W 6.00 7.00 8.00 9.00
118 X 11.00 12.00 13.00 14.00
119 Y 16.00 17.00 18.00 19.00
120 Z 21.00 22.00 23.00 24.00
121 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10
122 -- -- -- -- -- -- -- -- -- ---
124 4 5 6 7 8 9 10 11 12 13
125 CASE_LBL VAR000 VAR001
126 -------- -------- --------
138 if [ $? -ne 0 ] ; then fail ; fi