tests: Convert multipass.sh test to Autotest framework.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 10 Oct 2010 20:15:58 +0000 (13:15 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 10 Oct 2010 20:15:58 +0000 (13:15 -0700)
tests/automake.mk
tests/bugs/multipass.sh [deleted file]
tests/language/stats/descriptives.at

index ffcf6a2654b0444088d2b69a33b09837d457618e..3a0e5c05e6ae9c4c3b12482ffbc510a6fc3c16f3 100644 (file)
@@ -27,7 +27,6 @@ dist_TESTS = \
        tests/formats/wkday-in.sh \
        tests/formats/wkday-out.sh \
        tests/formats/360.sh \
-       tests/bugs/multipass.sh \
        tests/bugs/overwrite-input-file.sh \
        tests/bugs/overwrite-special-file.sh \
        tests/bugs/shbang.sh \
diff --git a/tests/bugs/multipass.sh b/tests/bugs/multipass.sh
deleted file mode 100755 (executable)
index dc70544..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/bin/sh
-
-# This program tests for a bug which caused UNIFORM(x) to always return zero.
-
-
-TEMPDIR=/tmp/pspp-tst-$$
-TESTFILE=$TEMPDIR/`basename $0`.sps
-
-# ensure that top_builddir  are absolute
-if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
-if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
-top_builddir=`cd $top_builddir; pwd`
-PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT
-
-# ensure that top_srcdir is absolute
-top_srcdir=`cd $top_srcdir; pwd`
-
-STAT_CONFIG_PATH=$top_srcdir/config
-export STAT_CONFIG_PATH
-
-
-cleanup()
-{
-     if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then 
-       echo "NOT cleaning $TEMPDIR" 
-       return ; 
-     fi
-     cd /
-     rm -rf $TEMPDIR
-}
-
-
-fail()
-{
-    echo $activity
-    echo FAILED
-    cleanup;
-    exit 1;
-}
-
-
-no_result()
-{
-    echo $activity
-    echo NO RESULT;
-    cleanup;
-    exit 2;
-}
-
-pass()
-{
-    cleanup;
-    exit 0;
-}
-
-mkdir -p $TEMPDIR
-
-cd $TEMPDIR
-
-activity="create program"
-cat > $TESTFILE <<EOF
-data list list /ID * ABC *.
-begin data.
-1 3.5
-2 2.0
-3 2.0
-4 3.5
-5 3.0
-6 4.0
-7 5.0
-end data.
-
-TEMPORARY.
-SELECT IF id < 7 .
-
-DESCRIPTIVES
-        /VAR=abc.
-EOF
-if [ $? -ne 0 ] ; then no_result ; fi
-
-$SUPERVISOR $PSPP -o pspp.csv $TESTFILE
-if [ $? -ne 0 ] ; then no_result ; fi
-
-
-diff -c $TEMPDIR/pspp.csv - << EOF
-Table: Reading free-form data from INLINE.
-Variable,Format
-ID,F8.0
-ABC,F8.0
-
-Table: Valid cases = 6; cases with missing value(s) = 0.
-Variable,N,Mean,Std Dev,Minimum,Maximum
-ABC,6,3.00,.84,2.00,4.00
-EOF
-if [ $? -ne 0 ] ; then fail ; fi
-
-pass;
index ec05f1b99759988259b32df1f443b2a3be3d1ca2..9c6be8d38fe3d3225423c4dddaaa6a55a494763a 100644 (file)
@@ -157,3 +157,31 @@ Variable,N,Mean
 X,6,2.500
 ])
 AT_CLEANUP
+
+dnl Git history shows that this was probably a bug in the PSPP
+dnl core regarding multipass procedures, not anything specific
+dnl to DESCRIPTIVES.
+AT_SETUP([DESCRIPTIVES bug with TEMPORARY])
+AT_DATA([descriptives.sps], [dnl
+DATA LIST LIST NOTABLE /id * abc *.
+BEGIN DATA.
+1 3.5
+2 2.0
+3 2.0
+4 3.5
+5 3.0
+6 4.0
+7 5.0
+END DATA.
+
+TEMPORARY.
+SELECT IF id < 7 .
+
+DESCRIPTIVES /VAR=abc.
+])
+AT_CHECK([pspp -O format=csv descriptives.sps], [0], [dnl
+Table: Valid cases = 6; cases with missing value(s) = 0.
+Variable,N,Mean,Std Dev,Minimum,Maximum
+abc,6,3.00,.84,2.00,4.00
+])
+AT_CLEANUP