From: Ben Pfaff Date: Tue, 5 Oct 2010 00:33:55 +0000 (-0700) Subject: tests: Convert system file tests to Autotest framework. X-Git-Tag: v0.7.6~92 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ab3b7df3996d059d8efd8e9b8c5bdbd1cae84a1;p=pspp-builds.git tests: Convert system file tests to Autotest framework. --- diff --git a/tests/automake.mk b/tests/automake.mk index fa5c5365..13e4e989 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/sysfiles.sh \ tests/command/sysfiles-old.sh \ tests/command/sysfile-info.sh \ tests/command/split-file.sh \ diff --git a/tests/command/sysfiles-old.sh b/tests/command/sysfiles-old.sh deleted file mode 100755 index 60cce7e5..00000000 --- a/tests/command/sysfiles-old.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh - -# This program tests that system files can be read and written -# without the long name tables. - - -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 < /dev/null -if [ $? -ne 0 ] ; then no_result ; fi - -# Ensure that the written file has no long name table -activity="check sysfile type" -grep 'X=X' $TEMPDIR/foo.sav -if [ $? -eq 0 ] ; then fail ; fi - -activity="compare output" -diff -c $TEMPDIR/pspp.csv - << EOF -Table: Data List -x,variable,variab_a,variab_b -1.00,1.00,1.00,2.00 -1.00,1.00,2.00,30.00 -1.00,2.00,1.00,8.00 -1.00,2.00,2.00,20.00 -2.00,1.00,1.00,2.00 -2.00,1.00,2.00,22.00 -2.00,2.00,1.00,1.00 -2.00,2.00,2.00,3.00 -EOF -if [ $? -ne 0 ] ; then fail ; fi - -pass; diff --git a/tests/command/sysfiles.sh b/tests/command/sysfiles.sh deleted file mode 100755 index 2cee8952..00000000 --- a/tests/command/sysfiles.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh - -# This program tests that system files can be read and written -# including the long variable names. - - -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 <