Added infrastructure for the ONEWAY command.
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 22 Oct 2004 08:00:39 +0000 (08:00 +0000)
committerJohn Darrington <john@darrington.wattle.id.au>
Fri, 22 Oct 2004 08:00:39 +0000 (08:00 +0000)
tests/Makefile.am
tests/command/oneway.sh [new file with mode: 0755]

index ac622c1b074b74cd31b79590013ed7e3f904f667..a988206717434bed2c433c1152fe986f4aea39ee 100644 (file)
@@ -15,6 +15,7 @@ TESTS = \
        command/lag.sh \
        command/list.sh \
        command/loop.sh \
+       command/oneway.sh \
        command/print.sh \
        command/sample.sh \
        command/sort.sh \
diff --git a/tests/command/oneway.sh b/tests/command/oneway.sh
new file mode 100755 (executable)
index 0000000..193ab64
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# This program tests that the ONEWAY anova command works OK
+
+TEMPDIR=/tmp/pspp-tst-$$
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+     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 > $TEMPDIR/out.stat <<EOF
+data list list /id * cables * price *.
+begin data.
+1 2.0 3.0
+2 1.0 2.0
+3 2.0 4.5
+4 2.0 4.5
+5 3.0 6.0
+end data.
+
+ONEWAY 
+ id cables BY price
+ /STATISTICS descriptives homogeneity
+ /MISSING analysis .
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+activity="run program"
+$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/out.stat
+if [ $? -ne 0 ] ; then no_result ; fi
+
+pass