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
55 # Use crosstabs, since its TABLES subcommand exercises the array var set
57 activity="create program"
59 DATA LIST LIST /AlphaBetaGamma * B * X * Yabbadabbadoo * .
67 VARIABLES X (1,7) Yabbadabbadoo (1,7)
68 /TABLES X BY Yabbadabbadoo.
70 if [ $? -ne 0 ] ; then no_result ; fi
73 activity="run program"
74 $SUPERVISOR $PSPP -o raw-ascii $TESTFILE
75 if [ $? -ne 0 ] ; then no_result ; fi
77 activity="compare output"
78 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
79 diff -b $TEMPDIR/pspp.list - <<EOF
80 1.1 DATA LIST. Reading free-form data from INLINE.
81 +--------------+------+
83 #==============#======#
84 |AlphaBetaGamma|F8.0 |
87 |Yabbadabbadoo |F8.0 |
88 +--------------+------+
89 AlphaBetaGamma B X Yabbadabbadoo
90 -------------- -------- -------- -------------
92 2.1 CROSSTABS. Summary.
93 #===============#=====================================================#
95 # #-----------------+-----------------+-----------------#
96 # # Valid | Missing | Total #
97 # #--------+--------+--------+--------+--------+--------#
98 # # N| Percent| N| Percent| N| Percent#
99 #---------------#--------+--------+--------+--------+--------+--------#
100 #X * # 1| 100.0%| 0| 0.0%| 1| 100.0%#
101 #Yabbadabbadoo # | | | | | #
102 #===============#========#========#========#========#========#========#
103 2.2 CROSSTABS. X by Yabbadabbadoo [count].
104 #===============#==============================================================#========#
105 # # Yabbadabbadoo | #
106 # #--------+--------+--------+--------+--------+--------+--------+ #
107 # X# 1.00| 2.00| 3.00| 4.00| 5.00| 6.00| 7.00| Total #
108 #---------------#--------+--------+--------+--------+--------+--------+--------+--------#
109 # 1.00# .0| .0| .0| .0| .0| .0| .0| .0#
110 # 2.00# .0| .0| .0| .0| .0| .0| .0| .0#
111 # 3.00# .0| .0| .0| .0| .0| .0| .0| .0#
112 # 4.00# .0| .0| .0| .0| 1.0| .0| .0| 1.0#
113 # 5.00# .0| .0| .0| .0| .0| .0| .0| .0#
114 # 6.00# .0| .0| .0| .0| .0| .0| .0| .0#
115 # 7.00# .0| .0| .0| .0| .0| .0| .0| .0#
116 #Total # .0%| .0%| .0%| .0%| 1.0%| .0%| .0%| 1.0%#
117 #===============#========#========#========#========#========#========#========#========#
119 if [ $? -ne 0 ] ; then fail ; fi