From a963b40705139469a43f5a117ceba66923b38785 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 10 Jun 2009 21:11:32 +0800 Subject: [PATCH] Added test for the ROC command --- tests/automake.mk | 1 + tests/command/roc.sh | 170 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 171 insertions(+) create mode 100755 tests/command/roc.sh diff --git a/tests/automake.mk b/tests/automake.mk index 7bfd77bf..9824a9fe 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -56,6 +56,7 @@ dist_TESTS = \ tests/command/regression.sh \ tests/command/regression-qr.sh \ tests/command/reliability.sh \ + tests/command/roc.sh \ tests/command/sample.sh \ tests/command/sort.sh \ tests/command/sysfiles.sh \ diff --git a/tests/command/roc.sh b/tests/command/roc.sh new file mode 100755 index 00000000..df3312be --- /dev/null +++ b/tests/command/roc.sh @@ -0,0 +1,170 @@ +#!/bin/sh + +# This program tests the ROC command. + +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 + +# ensure that top_srcdir is absolute +top_srcdir=`cd $top_srcdir; pwd` + +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 + 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 <