From 973fb7a1cd984715bc5e1f46a8b8922e5a5f6fd7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 4 Oct 2010 11:25:25 -0700 Subject: [PATCH] RANK: Convert tests to Autotest framework. --- tests/automake.mk | 2 +- .../rank.sh => language/stats/rank.at} | 711 ++++++++---------- 2 files changed, 315 insertions(+), 398 deletions(-) rename tests/{command/rank.sh => language/stats/rank.at} (59%) mode change 100755 => 100644 diff --git a/tests/automake.mk b/tests/automake.mk index ad83e1c8..72395adb 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -10,7 +10,6 @@ TESTS_ENVIRONMENT += LC_ALL=C TESTS_ENVIRONMENT += EXEEXT=$(EXEEXT) dist_TESTS = \ - tests/command/rank.sh \ tests/command/rename.sh \ tests/command/regression.sh \ tests/command/regression-qr.sh \ @@ -379,6 +378,7 @@ TESTSUITE_AT = \ tests/language/stats/frequencies.at \ tests/language/stats/npar.at \ tests/language/stats/oneway.at \ + tests/language/stats/rank.at \ tests/language/utilities/insert.at \ tests/language/utilities/permissions.at \ tests/language/utilities/set.at \ diff --git a/tests/command/rank.sh b/tests/language/stats/rank.at old mode 100755 new mode 100644 similarity index 59% rename from tests/command/rank.sh rename to tests/language/stats/rank.at index 62677882..ac44189c --- a/tests/command/rank.sh +++ b/tests/language/stats/rank.at @@ -1,153 +1,7 @@ -#!/bin/sh +AT_BANNER([RANK]) -# This program tests the RANK command. - -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 - 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 - - -# Some tests for proper behaviour in the face of invalid input. -activity="create file 1" -cat > $TESTFILE < $TESTFILE < $TESTFILE < $TESTFILE <