From b7a1f18b5206b1083038779158025e2ab36c2ef9 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 6 Aug 2010 19:06:40 +0200 Subject: [PATCH] Migrate the tests for the ONEWAY command to autotest style --- tests/automake.mk | 4 +- tests/command/oneway-missing.sh | 177 ------------------ tests/command/oneway-with-splits.sh | 177 ------------------ tests/command/oneway.sh | 138 -------------- tests/language/stats/oneway.at | 278 ++++++++++++++++++++++++++++ 5 files changed, 279 insertions(+), 495 deletions(-) delete mode 100755 tests/command/oneway-missing.sh delete mode 100755 tests/command/oneway-with-splits.sh delete mode 100755 tests/command/oneway.sh create mode 100644 tests/language/stats/oneway.at diff --git a/tests/automake.mk b/tests/automake.mk index 354c97b0..abf61d15 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -44,9 +44,6 @@ dist_TESTS = \ tests/command/npar-chisquare.sh \ tests/command/npar-wilcoxon.sh \ tests/command/npar-sign.sh \ - tests/command/oneway.sh \ - tests/command/oneway-missing.sh \ - tests/command/oneway-with-splits.sh \ tests/command/permissions.sh \ tests/command/print.sh \ tests/command/print-strings.sh \ @@ -431,6 +428,7 @@ TESTSUITE_AT = \ tests/language/stats/factor.at \ tests/language/stats/flip.at \ tests/language/stats/frequencies.at \ + tests/language/stats/oneway.at \ tests/language/xforms/compute.at \ tests/language/xforms/recode.at \ tests/math/moments.at \ diff --git a/tests/command/oneway-missing.sh b/tests/command/oneway-missing.sh deleted file mode 100755 index c68e5ea1..00000000 --- a/tests/command/oneway-missing.sh +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/sh - -# This program tests that the ONEWAY anova command works OK when there is missing data - -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 < $TESTFILE < $TESTFILE < $TESTFILE < $TESTFILE < first.out], [0]) + +AT_CHECK([pspp -O format=csv oneway-missing2.sps > second.out], [0]) + +AT_CHECK([diff first.out second.out], [0], []) + +dnl Now a test with missing values in the independent variable +AT_DATA([oneway-missing3.sps], +[DATA LIST NOTABLE LIST /v1 * v2 * dep * vn * . +BEGIN DATA +4 2 . 2 +3 3 1 2 +2 2 1 2 +1 1 1 2 +1 1 1 2 +4 4 1 2 +5 5 2 2 +2 2 2 2 +4 4 2 2 +2 2 2 2 +3 3 2 2 +7 7 3 2 +4 4 3 2 +5 5 3 4 +3 3 3 2 +6 6 3 2 +END DATA + +ONEWAY + v1 v2 BY dep + /STATISTICS descriptives homogeneity + /MISSING ANALYSIS + . +]) + +AT_CHECK([pspp -O format=csv oneway-missing3.sps > third.out], [0]) + +AT_CHECK([diff first.out third.out], [0], []) + +AT_CLEANUP -- 2.30.2