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
53 activity="generate data input file"
54 $PERL -e 'print pack "n", $_ foreach 0...65535' > bcd-in.data
56 activity="write pspp syntax"
57 cat > bcd-in.pspp <<'EOF'
61 FILE HANDLE data/NAME='bcd-in.data'/MODE=IMAGE/LRECL=2.
62 DATA LIST FILE=data/p 1-2 (P) pk 1-2 (PK).
63 COMPUTE x=$CASENUM - 1.
64 PRINT OUTFILE='bcd-in.out'/x (PIBHEX4) ' ' P PK.
67 if [ $? -ne 0 ] ; then no_result ; fi
69 activity="run program"
70 $SUPERVISOR $PSPP --testing-mode bcd-in.pspp
71 if [ $? -ne 0 ] ; then no_result ; fi
73 activity="gunzip expected results"
74 gzip -cd < $top_srcdir/tests/formats/bcd-in.expected.cmp.gz > bcd-in.expected.cmp
75 if [ $? -ne 0 ] ; then no_result ; fi
77 activity="decompress expected results"
78 $PERL -pe "printf ' %04X ', $.-1" < bcd-in.expected.cmp > bcd-in.expected
79 if [ $? -ne 0 ] ; then no_result ; fi
81 activity="compare output"
82 diff -u bcd-in.expected bcd-in.out
83 if [ $? -ne 0 ] ; then fail ; fi