3 # This program tests that the T-TEST /TESTVAL command works OK
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`
13 # ensure that top_srcdir is absolute
14 top_srcdir=`cd $top_srcdir; pwd`
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
54 activity="create program"
56 data list list /ID * ABC *.
66 t-test /testval=2.0 /var=abc.
68 if [ $? -ne 0 ] ; then no_result ; fi
71 activity="run program"
72 $SUPERVISOR $top_builddir/src/pspp -o raw-ascii $TESTFILE
73 if [ $? -ne 0 ] ; then no_result ; fi
75 activity="compare output"
76 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
77 diff -b $TEMPDIR/pspp.list - <<EOF
78 1.1 DATA LIST. Reading free-form data from INLINE.
85 2.1 T-TEST. One-Sample Statistics
86 #===#=#====#==============#========#
87 # #N|Mean|Std. Deviation|SE. Mean#
88 #===#=#====#==============#========#
89 #ABC#6|3.00| .84| .342#
90 #===#=#====#==============#========#
91 2.2 T-TEST. One-Sample Test
92 #===#=====================================================#
93 # # Test Value = 2.000000 #
94 # #-----+--+---------------+---------------+------------#
96 # # | | | +-----+------#
97 # # t |df|Sig. (2-tailed)|Mean Difference|Lower| Upper#
98 #===#=====#==#===============#===============#=====#======#
99 #ABC#2.928| 5| .033| 1.000|.1220|1.8780#
100 #===#=====#==#===============#===============#=====#======#
102 if [ $? -ne 0 ] ; then fail ; fi