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
11 # ensure that top_srcdir is absolute
12 top_srcdir=`cd $top_srcdir; pwd`
14 STAT_CONFIG_PATH=$top_srcdir/config
15 export STAT_CONFIG_PATH
52 activity="generate data input file"
53 $PERL -e 'print pack "n", $_ foreach 0...65535' > bcd-in.data
55 activity="write pspp syntax"
56 cat > bcd-in.pspp <<'EOF'
60 FILE HANDLE data/NAME='bcd-in.data'/MODE=IMAGE/LRECL=2.
61 DATA LIST FILE=data/p 1-2 (P) pk 1-2 (PK).
62 COMPUTE x=$CASENUM - 1.
63 PRINT OUTFILE='bcd-in.out'/x (PIBHEX4) ' ' P PK.
66 if [ $? -ne 0 ] ; then no_result ; fi
68 activity="run program"
69 $SUPERVISOR $PSPP --testing-mode bcd-in.pspp
70 if [ $? -ne 0 ] ; then no_result ; fi
72 activity="gunzip expected results"
73 gzip -cd < $top_srcdir/tests/formats/bcd-in.expected.cmp.gz > bcd-in.expected.cmp
74 if [ $? -ne 0 ] ; then no_result ; fi
76 activity="decompress expected results"
77 $PERL -pe "printf ' %04X ', $.-1" < bcd-in.expected.cmp > bcd-in.expected
78 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="compare output"
81 diff -u bcd-in.expected bcd-in.out
82 if [ $? -ne 0 ] ; then fail ; fi