3 # This program tests that SYSFILE INFO works.
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_builddir are absolute
9 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
10 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
11 top_builddir=`cd $top_builddir; pwd`
12 PSPP=$top_builddir/src/ui/terminal/pspp
14 # ensure that top_srcdir is absolute
15 top_srcdir=`cd $top_srcdir; pwd`
17 STAT_CONFIG_PATH=$top_srcdir/config
18 export STAT_CONFIG_PATH
25 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
26 echo "NOT cleaning $TEMPDIR"
61 activity="Create test file"
62 cat > $TESTFILE << EOF
63 DATA LIST LIST /x * name (a10) .
69 SAVE OUTFILE='pro.sav'.
71 sysfile info file='pro.sav'.
73 if [ $? -ne 0 ] ; then no_result ; fi
76 activity="run program"
77 $SUPERVISOR $PSPP --testing-mode $TESTFILE
78 if [ $? -ne 0 ] ; then no_result ; fi
80 activity="filter output"
81 egrep -v '^(Created|Endian|Integer Format|Real Format): ' $TEMPDIR/pspp.list > $TEMPDIR/out-filtered
82 if [ $? -ne 0 ] ; then no_result ; fi
84 activity="compare output"
85 perl -pi -e 's/^\s*$//g' $TEMPDIR/out-filtered
86 diff -b -w $TEMPDIR/out-filtered - << EOF
87 1.1 DATA LIST. Reading free-form data from INLINE.
100 Weight: Not weighted.
101 Mode: Compression on.
103 +--------+-------------+---+
104 |Variable|Description |Pos|
107 #========#=============#===#
108 |x |Format: F8.2 | 1|
112 +--------+-------------+---+
113 |name |Format: A10 | 2|
117 +--------+-------------+---+
119 if [ $? -ne 0 ] ; then fail ; fi