From 3384b8f946b446e849bad1bc7aad238b2e0a9691 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 2 Oct 2010 13:42:33 -0700 Subject: [PATCH] MATCH FILES: Convert tests to Autotest framework. --- tests/automake.mk | 3 +- tests/bugs/match-files-scratch.sh | 99 ---------- tests/command/match-files.sh | 262 -------------------------- tests/language/data-io/match-files.at | 200 ++++++++++++++++++++ 4 files changed, 201 insertions(+), 363 deletions(-) delete mode 100755 tests/bugs/match-files-scratch.sh delete mode 100755 tests/command/match-files.sh create mode 100644 tests/language/data-io/match-files.at diff --git a/tests/automake.mk b/tests/automake.mk index 28552295..39b16d90 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/match-files.sh \ tests/command/missing-values.sh \ tests/command/no_case_size.sh \ tests/command/n_of_cases.sh \ @@ -80,7 +79,6 @@ dist_TESTS = \ tests/bugs/get-no-file.sh \ tests/bugs/if_crash.sh \ tests/bugs/input-crash.sh \ - tests/bugs/match-files-scratch.sh \ tests/bugs/multipass.sh \ tests/bugs/overwrite-input-file.sh \ tests/bugs/overwrite-special-file.sh \ @@ -372,6 +370,7 @@ TESTSUITE_AT = \ tests/language/data-io/get-data-psql.at \ tests/language/data-io/get-data-txt.at \ tests/language/data-io/list.at \ + tests/language/data-io/match-files.at \ tests/language/data-io/save.at \ tests/language/data-io/save-translate.at \ tests/language/dictionary/attributes.at \ diff --git a/tests/bugs/match-files-scratch.sh b/tests/bugs/match-files-scratch.sh deleted file mode 100755 index 5d8df993..00000000 --- a/tests/bugs/match-files-scratch.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/sh - -# This program tests for a bug which caused MATCH FILES to crash -# when used with scratch variables. - - -TEMPDIR=/tmp/pspp-tst-$$ -TESTFILE=$TEMPDIR/`basename $0`.pspp - -# 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 < a.data < b.data < ff.out < ft.out < $name.pspp - if [ $? -ne 0 ] ; then no_result ; fi - - activity="run $name.pspp" - $SUPERVISOR $PSPP -o pspp.csv -e /dev/null $name.pspp - if [ $? -ne 0 ] ; then no_result ; fi - - activity="check $name output" - diff -c pspp.csv $types.out - if [ $? -ne 0 ] ; then fail ; fi - done -done - -# Test parallel match. -name="parallel" -activity="create $name.pspp" -cat > $name.pspp < $name.pspp <