3 # This program tests use of variables in expressions.
5 TEMPDIR=/tmp/pspp-tst-$$
9 # ensure that top_srcdir is absolute
10 cd $top_srcdir; top_srcdir=`pwd`
12 STAT_CONFIG_PATH=$top_srcdir/config
13 export STAT_CONFIG_PATH
50 activity="create program"
51 cat > $TEMPDIR/variables.stat <<EOF
55 DATA LIST /N1 TO N5 1-5.
56 MISSING VALUES N1 TO N5 (3 THRU 5, 1).
68 COMPUTE MC=NMISS(N1 TO N5).
69 COMPUTE VC=NVALID(N1 TO N5).
71 COMPUTE S1=SYSMIS(N1).
72 COMPUTE S2=SYSMIS(N2).
73 COMPUTE S3=SYSMIS(N3).
74 COMPUTE S4=SYSMIS(N4).
75 COMPUTE S5=SYSMIS(N5).
77 COMPUTE M1=MISSING(N1).
78 COMPUTE M2=MISSING(N2).
79 COMPUTE M3=MISSING(N3).
80 COMPUTE M4=MISSING(N4).
81 COMPUTE M5=MISSING(N5).
93 if [ $? -ne 0 ] ; then no_result ; fi
95 activity="run program"
96 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/variables.stat > $TEMPDIR/variables.err 2> $TEMPDIR/variables.out
97 if [ $? -ne 0 ] ; then fail ; fi
99 activity="compare results"
100 perl -pi -e s/^\s*\$//g $TEMPDIR/pspp.list
101 diff -b $TEMPDIR/pspp.list - <<EOF | perl -e 's/^\s*$//g'
102 1.1 DATA LIST. Reading 1 record from the command file.
103 +--------+------+-------+------+
104 |Variable|Record|Columns|Format|
105 #========#======#=======#======#
111 +--------+------+-------+------+
113 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
114 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
115 1 2 3 4 5 . 2 . . . 4 1 0 0 0 0 0 1 0 1 1 1 1 2 3 4 5
116 6 7 8 9 . 6 7 8 9 . 1 4 0 0 0 0 1 0 0 0 0 1 6 7 8 9 .
119 if [ $? -ne 0 ] ; then no_result ; fi
122 if [ $? -ne 0 ] ; then fail ; fi