Fix use of "export" to work with traditional shells.
[pspp] / tests / command / list.sh
index 33297eb00753813869e9499edf32f26c85260fc0..894b44f80f7ac204464246ef59ea0ea8370c041a 100755 (executable)
@@ -3,13 +3,15 @@
 # This program tests the LIST command.
 
 TEMPDIR=/tmp/pspp-tst-$$
+TESTFILE=$TEMPDIR/`basename $0`.sps
 
 here=`pwd`;
 
 # ensure that top_srcdir is absolute
 cd $top_srcdir; top_srcdir=`pwd`
 
-export STAT_CONFIG_PATH=$top_srcdir/config
+STAT_CONFIG_PATH=$top_srcdir/config
+export STAT_CONFIG_PATH
 
 
 cleanup()
@@ -47,13 +49,8 @@ cd $TEMPDIR
 
 
 activity="create program"
-cat > $TEMPDIR/list.stat << foobar
+cat > $TESTFILE << EOF
 *** Single lines.
-remark EOF
-----------------------------------------------------------------------
-Testing use of LIST in single-line cases.
-----------------------------------------------------------------------
-EOF
 data list file='$top_srcdir/tests/weighting.data'/AVAR 1-5 BVAR 6-10.
 weight by BVAR.
 list.
@@ -61,30 +58,21 @@ list.
 list /format numbered weight.
 
 *** Multiple lines.
-remark EOF
-----------------------------------------------------------------------
-Testing use of LIST in multi-line cases.
-----------------------------------------------------------------------
-EOF
 data list file='$top_srcdir/tests/list.data' notable /X000 to X126 1-127.
 *list /cases=from 1 to 25 by 5 /format numbered.
 list x000 to x030.
 list /cases=from 1 to 25.
 
-foobar
+EOF
 if [ $? -ne 0 ] ; then no_result ; fi
 
 activity="run program"
-$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/list.stat
+$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TESTFILE
 if [ $? -ne 0 ] ; then no_result ; fi
 
 
 activity="compare results"
 diff -b -B $TEMPDIR/pspp.list - <<EOF
-----------------------------------------------------------------------
-Testing use of LIST in single-line cases.
-----------------------------------------------------------------------
-
 1.1 DATA LIST.  Reading 1 record from file $top_srcdir/tests/weighting.data.
 +--------+------+-------+------+
 |Variable|Record|Columns|Format|
@@ -203,10 +191,6 @@ Case#  AVAR  BVAR
    51    80     1 
    52    94     1 
 
-----------------------------------------------------------------------
-Testing use of LIST in multi-line cases.
-----------------------------------------------------------------------
-
 X000 X001 X002 X003 X004 X005 X006 X007 X008 X009 X010 X011 X012 X013 X014 X015 X016 X017 X018 X019 X020 X021 X022 X023 X024 X025 X026 X027 X028 X029 X030
 ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
    7    6    7    5    3    2    4    6    6    3    4    8    5    1    3    7    8    9    0    7    3    4    8    3    1    0    6    4    0    9    1