3 TEMPDIR=/tmp/pspp-tst-$$
5 # ensure that top_builddir are absolute
6 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
7 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
8 top_builddir=`cd $top_builddir; pwd`
9 PSPP=$top_builddir/src/ui/terminal/pspp
12 # ensure that top_srcdir is absolute
13 top_srcdir=`cd $top_srcdir; pwd`
15 STAT_CONFIG_PATH=$top_srcdir/config
16 export STAT_CONFIG_PATH
21 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
22 echo "NOT cleaning $TEMPDIR"
57 activity="generate data input file"
58 $PERL -e 'print pack "n", $_ foreach 0...65535' > legacy-in.data
60 activity="write pspp syntax"
61 cat > legacy-in.pspp <<'EOF'
65 FILE HANDLE data/NAME='legacy-in.data'/MODE=IMAGE/LRECL=2.
66 DATA LIST FILE=data/n 1-2 (N) z 1-2 (z).
67 COMPUTE x=$CASENUM - 1.
68 PRINT OUTFILE='legacy-in.out'/x (PIBHEX4) ' ' N Z.
71 if [ $? -ne 0 ] ; then no_result ; fi
73 activity="run program"
74 $SUPERVISOR $PSPP --testing-mode legacy-in.pspp
75 if [ $? -ne 0 ] ; then no_result ; fi
77 activity="gunzip expected results"
78 gzip -cd < $top_srcdir/tests/formats/legacy-in.expected.cmp.gz > legacy-in.expected.cmp
79 if [ $? -ne 0 ] ; then no_result ; fi
81 activity="decompress expected results"
82 $PERL -pe "printf ' %04X ', $.-1" < legacy-in.expected.cmp > legacy-in.expected
83 if [ $? -ne 0 ] ; then no_result ; fi
85 activity="compare output"
86 diff -u legacy-in.expected legacy-in.out
87 if [ $? -ne 0 ] ; then fail ; fi