3 # This program tests that both long and short variable names are parsed OK.
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 # Use crosstabs, since its TABLES subcommand exercises the array var set
63 activity="create program"
65 DATA LIST LIST /AlphaBetaGamma * B * X * Yabbadabbadoo * .
73 VARIABLES X (1,7) Yabbadabbadoo (1,7)
74 /TABLES X BY Yabbadabbadoo.
76 if [ $? -ne 0 ] ; then no_result ; fi
79 activity="run program"
80 $SUPERVISOR $PSPP --testing-mode $TESTFILE
81 if [ $? -ne 0 ] ; then no_result ; fi
83 activity="compare output"
84 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
85 diff -b $TEMPDIR/pspp.list - <<EOF
86 1.1 DATA LIST. Reading free-form data from INLINE.
87 +--------------+------+
89 #==============#======#
90 |AlphaBetaGamma|F8.0 |
93 |Yabbadabbadoo |F8.0 |
94 +--------------+------+
95 AlphaBetaGamma B X Yabbadabbadoo
96 -------------- -------- -------- -------------
98 2.1 CROSSTABS. Summary.
99 #===============#=====================================================#
101 # #-----------------+-----------------+-----------------#
102 # # Valid | Missing | Total #
103 # #--------+--------+--------+--------+--------+--------#
104 # # N| Percent| N| Percent| N| Percent#
105 #---------------#--------+--------+--------+--------+--------+--------#
106 #X * # 1| 100.0%| 0| 0.0%| 1| 100.0%#
107 #Yabbadabbadoo # | | | | | #
108 #===============#========#========#========#========#========#========#
109 2.2 CROSSTABS. X by Yabbadabbadoo [count].
110 #===============#==============================================================#========#
111 # # Yabbadabbadoo | #
112 # #--------+--------+--------+--------+--------+--------+--------+ #
113 # X# 1.00| 2.00| 3.00| 4.00| 5.00| 6.00| 7.00| Total #
114 #---------------#--------+--------+--------+--------+--------+--------+--------+--------#
115 # 1.00# .0| .0| .0| .0| .0| .0| .0| .0#
116 # 2.00# .0| .0| .0| .0| .0| .0| .0| .0#
117 # 3.00# .0| .0| .0| .0| .0| .0| .0| .0#
118 # 4.00# .0| .0| .0| .0| 1.0| .0| .0| 1.0#
119 # 5.00# .0| .0| .0| .0| .0| .0| .0| .0#
120 # 6.00# .0| .0| .0| .0| .0| .0| .0| .0#
121 # 7.00# .0| .0| .0| .0| .0| .0| .0| .0#
122 #Total # .0| .0| .0| .0| 1.0| .0| .0| 1.0#
123 #===============#========#========#========#========#========#========#========#========#
125 if [ $? -ne 0 ] ; then fail ; fi