NPAR TESTS: Convert SIGN test to Autotest framework.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 3 Oct 2010 12:42:58 +0000 (05:42 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 3 Oct 2010 22:46:06 +0000 (15:46 -0700)
tests/automake.mk
tests/command/npar-sign.sh [deleted file]
tests/language/stats/npar.at

index 5f28780ba6b1a21c4ab975c3fc78eb4e8063573c..952411086cb4dcec31492ce0d13eb61d38d4282b 100644 (file)
@@ -10,7 +10,6 @@ TESTS_ENVIRONMENT += LC_ALL=C
 TESTS_ENVIRONMENT += EXEEXT=$(EXEEXT)
 
 dist_TESTS = \
-       tests/command/npar-sign.sh \
        tests/command/permissions.sh \
        tests/command/print.sh \
        tests/command/print-strings.sh \
diff --git a/tests/command/npar-sign.sh b/tests/command/npar-sign.sh
deleted file mode 100755 (executable)
index 6b85aef..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/sh
-
-# This program tests the SIGN subcommand of npar tests
-
-TEMPDIR=/tmp/pspp-tst-$$
-TESTFILE=$TEMPDIR/`basename $0`.sps
-
-# ensure that top_srcdir and top_builddir  are absolute
-if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
-if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
-top_srcdir=`cd $top_srcdir; pwd`
-top_builddir=`cd $top_builddir; pwd`
-
-PSPP=$top_builddir/src/ui/terminal/pspp$EXEEXT
-
-STAT_CONFIG_PATH=$top_srcdir/config
-export STAT_CONFIG_PATH
-
-LANG=C
-export LANG
-
-
-cleanup()
-{
-     if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then 
-       echo "NOT cleaning $TEMPDIR"
-       return ; 
-     fi
-     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 1"
-cat > $TESTFILE <<  EOF
-set format = F9.3.
-
-data list notable list /age * height rank *.
-begin data.
-10 12 11
-12 13 13 
-13 14 12
-12 12 10
-9   9 10
-10.3 10.2 12
-end data.
-
-npar tests
-       /sign=age height WITH height rank (PAIRED)
-       /MISSING ANALYSIS
-       /METHOD=EXACT
-       .
-EOF
-if [ $? -ne 0 ] ; then no_result ; fi
-
-
-activity="run program 1"
-$SUPERVISOR $PSPP -o pspp.csv $TESTFILE
-if [ $? -ne 0 ] ; then no_result ; fi
-
-activity="compare output 1"
-diff -b -c - $TEMPDIR/pspp.csv <<EOF
-Table: Frequencies
-,,N
-height - age,Negative Differences,1
-,Positive Differences,3
-,Ties,2
-,Total,6
-rank - height,Negative Differences,3
-,Positive Differences,2
-,Ties,1
-,Total,6
-
-Table: Test Statistics
-,height - age,rank - height
-Exact Sig. (2-tailed),.625,1.000
-Exact Sig. (1-tailed),.312,.500
-Point Probability,.250,.312
-EOF
-if [ $? -ne 0 ] ; then fail ; fi
-
-
-pass;
index 47926a79678daa6b7e287ad3a2ac9af6338866b4..b2797a51caaf71354c479742e3e99e9feafdddd5 100644 (file)
@@ -588,3 +588,44 @@ Exact Sig. (2-tailed),.89
 Exact Sig. (1-tailed),.45
 ])
 AT_CLEANUP
+
+AT_SETUP([NPAR TESTS SIGN])
+AT_DATA([npar.sps], [dnl
+set format = F9.3.
+
+data list notable list /age * height rank *.
+begin data.
+10 12 11
+12 13 13 
+13 14 12
+12 12 10
+9   9 10
+10.3 10.2 12
+end data.
+
+npar tests
+       /sign=age height WITH height rank (PAIRED)
+       /MISSING ANALYSIS
+       /METHOD=EXACT
+       .
+])
+AT_CHECK([pspp -o pspp.csv npar.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
+Table: Frequencies
+,,N
+height - age,Negative Differences,1
+,Positive Differences,3
+,Ties,2
+,Total,6
+rank - height,Negative Differences,3
+,Positive Differences,2
+,Ties,1
+,Total,6
+
+Table: Test Statistics
+,height - age,rank - height
+Exact Sig. (2-tailed),.625,1.000
+Exact Sig. (1-tailed),.312,.500
+Point Probability,.250,.312
+])
+AT_CLEANUP