3 # This program tests use of variables in expressions.
5 TEMPDIR=/tmp/pspp-tst-$$
7 # ensure that top_srcdir and top_builddir are absolute
8 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 top_srcdir=`cd $top_srcdir; pwd`
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
14 STAT_CONFIG_PATH=$top_srcdir/config
15 export STAT_CONFIG_PATH
22 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
23 echo "NOT cleaning $TEMPDIR"
58 activity="create program"
59 cat > $TEMPDIR/variables.stat <<EOF
63 DATA LIST /N1 TO N5 1-5.
64 MISSING VALUES N1 TO N5 (3 THRU 5, 1).
76 COMPUTE MC=NMISS(N1 TO N5).
77 COMPUTE VC=NVALID(N1 TO N5).
79 COMPUTE S1=SYSMIS(N1).
80 COMPUTE S2=SYSMIS(N2).
81 COMPUTE S3=SYSMIS(N3).
82 COMPUTE S4=SYSMIS(N4).
83 COMPUTE S5=SYSMIS(N5).
85 COMPUTE M1=MISSING(N1).
86 COMPUTE M2=MISSING(N2).
87 COMPUTE M3=MISSING(N3).
88 COMPUTE M4=MISSING(N4).
89 COMPUTE M5=MISSING(N5).
101 if [ $? -ne 0 ] ; then no_result ; fi
103 activity="run program"
104 $SUPERVISOR $PSPP --testing-mode $TEMPDIR/variables.stat > $TEMPDIR/variables.err 2> $TEMPDIR/variables.out
105 if [ $? -ne 0 ] ; then fail ; fi
107 activity="compare results"
108 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
109 diff -b $TEMPDIR/pspp.list - <<EOF
110 1.1 DATA LIST. Reading 1 record from INLINE.
111 +--------+------+-------+------+
112 |Variable|Record|Columns|Format|
113 #========#======#=======#======#
119 +--------+------+-------+------+
120 N1 N2 N3 N4 N5 P1 P2 P3 P4 P5 MC VC S1 S2 S3 S4 S5 M1 M2 M3 M4 M5 V1 V2 V3 V4 V5
121 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
122 1 2 3 4 5 . 2 . . . 4 1 0 0 0 0 0 1 0 1 1 1 1 2 3 4 5
123 6 7 8 9 . 6 7 8 9 . 1 4 0 0 0 0 1 0 0 0 0 1 6 7 8 9 .
126 if [ $? -ne 0 ] ; then no_result ; fi
129 if [ $? -ne 0 ] ; then fail ; fi