From: Ben Pfaff Date: Thu, 30 Sep 2010 03:34:28 +0000 (-0700) Subject: DATA LIST: Convert tests for line-ends compatibility to use Autotest. X-Git-Tag: v0.7.6~136 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=889ab43a7bce4a4dc6e76e1ed1216deaa6770498;p=pspp-builds.git DATA LIST: Convert tests for line-ends compatibility to use Autotest. --- diff --git a/tests/automake.mk b/tests/automake.mk index 986e9ec2..19a2798e 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/line-ends.sh \ tests/command/list.sh \ tests/command/loop.sh \ tests/command/longvars.sh \ diff --git a/tests/command/line-ends.sh b/tests/command/line-ends.sh deleted file mode 100755 index 76499629..00000000 --- a/tests/command/line-ends.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/sh - -# This program tests that DATA LIST can be used to read input files -# with varying line ends (LF only, CR LF, CR only). - -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 - -# Create command file. -activity="create program" -cat > $TESTFILE << EOF -data list list notable file='input.txt'/a b c. -list. -EOF -if [ $? -ne 0 ] ; then no_result ; fi - - -activity="create input.txt" -printf '1 2 3\n4 5 6\r\n7\r8\r9\r\n10 11 12\n13 14 15 \r\n16\r\r17\r18\n' > input.txt -if [ $? -ne 0 ] ; then no_result ; fi - - -# Make sure that input.txt actually received the data that we expect. -# It might not have, if we're running on a system that translates \n -# into some other sequence. -activity="check input.txt" -cksum input.txt > input.cksum -diff input.cksum - < input.txt +dnl Make sure that input.txt actually received the data that we expect. +dnl It might not have, if we're running on a system that translates \n +dnl into some other sequence. +AT_CHECK([cksum input.txt], [0], [1732021750 50 input.txt +]) +AT_CHECK([pspp -o pspp.csv data-list.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +Table: Data List +a,b,c +1.00,2.00,3.00 +4.00,5.00,6.00 +7.00,8.00,9.00 +10.00,11.00,12.00 +13.00,14.00,15.00 +16.00,17.00,18.00 +]) +AT_CLEANUP