From: Ben Pfaff Date: Thu, 14 Oct 2010 01:43:43 +0000 (-0700) Subject: data-in: Convert test for WKDAY format to Autotest framework. X-Git-Tag: v0.7.6~14 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;h=b0003d3e325f1aadabea58d219e94c697d7c78a3;p=pspp-builds.git data-in: Convert test for WKDAY format to Autotest framework. --- diff --git a/tests/automake.mk b/tests/automake.mk index d113ba3f..36d92aeb 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -15,7 +15,6 @@ dist_TESTS = \ tests/formats/num-in.sh \ tests/formats/num-out.sh \ tests/formats/time-in.sh \ - tests/formats/wkday-in.sh \ tests/formats/360.sh TESTS = $(dist_TESTS) $(nodist_TESTS) diff --git a/tests/data/data-in.at b/tests/data/data-in.at index 7806e9b9..3f8acc22 100644 --- a/tests/data/data-in.at +++ b/tests/data/data-in.at @@ -142,3 +142,63 @@ AT_CHECK([gzip -cd < $top_srcdir/tests/data/legacy-in.expected.cmp.gz | \ AT_CHECK([pspp -O format=csv legacy-in.sps]) AT_CHECK([cat legacy-in.out], [0], [expout]) AT_CLEANUP + +AT_SETUP([WKDAY input format]) +AT_DATA([wkday.sps], [dnl +DATA LIST NOTABLE /wkday2 1-2 (wkday) + wkday3 1-3 (wkday) + wkday4 1-4 (wkday) + wkday5 1-5 (wkday) + wkday6 1-6 (wkday) + wkday7 1-7 (wkday) + wkday8 1-8 (wkday) + wkday9 1-9 (wkday) + wkday10 1-10 (wkday). +BEGIN DATA. + +. +monady +tuseday +WEDENSDAY +Thurdsay +fRidya +SAturady +sudnay +sturday +END DATA. +FORMATS ALL (WKDAY2). +PRINT OUTFILE='wkday.out'/ALL. +EXECUTE. +]) +AT_CHECK([pspp -O format=csv wkday.sps], [0], [dnl +wkday.sps:20.1-2: warning: Data for variable wkday2 is not valid as format WKDAY: Unrecognized weekday name. At least the first two letters of an English weekday name must be specified. + +wkday.sps:20.1-3: warning: Data for variable wkday3 is not valid as format WKDAY: Unrecognized weekday name. At least the first two letters of an English weekday name must be specified. + +wkday.sps:20.1-4: warning: Data for variable wkday4 is not valid as format WKDAY: Unrecognized weekday name. At least the first two letters of an English weekday name must be specified. + +wkday.sps:20.1-5: warning: Data for variable wkday5 is not valid as format WKDAY: Unrecognized weekday name. At least the first two letters of an English weekday name must be specified. + +wkday.sps:20.1-6: warning: Data for variable wkday6 is not valid as format WKDAY: Unrecognized weekday name. At least the first two letters of an English weekday name must be specified. + +wkday.sps:20.1-7: warning: Data for variable wkday7 is not valid as format WKDAY: Unrecognized weekday name. At least the first two letters of an English weekday name must be specified. + +wkday.sps:20.1-8: warning: Data for variable wkday8 is not valid as format WKDAY: Unrecognized weekday name. At least the first two letters of an English weekday name must be specified. + +wkday.sps:20.1-9: warning: Data for variable wkday9 is not valid as format WKDAY: Unrecognized weekday name. At least the first two letters of an English weekday name must be specified. + +wkday.sps:20.1-10: warning: Data for variable wkday10 is not valid as format WKDAY: Unrecognized weekday name. At least the first two letters of an English weekday name must be specified. +]) +AT_CHECK([cat wkday.out], [0], [dnl + . . . . . . . . . @&t@ + . . . . . . . . . @&t@ + MO MO MO MO MO MO MO MO MO @&t@ + TU TU TU TU TU TU TU TU TU @&t@ + WE WE WE WE WE WE WE WE WE @&t@ + TH TH TH TH TH TH TH TH TH @&t@ + FR FR FR FR FR FR FR FR FR @&t@ + SA SA SA SA SA SA SA SA SA @&t@ + SU SU SU SU SU SU SU SU SU @&t@ + . . . . . . . . . @&t@ +]) +AT_CLEANUP diff --git a/tests/formats/wkday-in.sh b/tests/formats/wkday-in.sh deleted file mode 100755 index 77382012..00000000 --- a/tests/formats/wkday-in.sh +++ /dev/null @@ -1,89 +0,0 @@ -#! /bin/sh - -TEMPDIR=/tmp/pspp-tst-$$ -mkdir -p $TEMPDIR -trap 'cd /; rm -rf $TEMPDIR' 0 - -# 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 - -fail() -{ - echo $activity - echo FAILED - exit 1; -} - - -no_result() -{ - echo $activity - echo NO RESULT; - exit 2; -} - -pass() -{ - exit 0; -} - -cd $TEMPDIR - -activity="write pspp syntax" -cat > wkday-in.pspp <