From 42f90f5cd49c722219172fa067d937d923f8e9ec Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 13 Oct 2010 18:48:14 -0700 Subject: [PATCH] data-in: Convert test for MONTH format to Autotest framework. --- tests/automake.mk | 1 - tests/data/data-in.at | 159 +++++++++++++++++++++++++++++++++++++ tests/formats/month-in.sh | 162 -------------------------------------- 3 files changed, 159 insertions(+), 163 deletions(-) delete mode 100755 tests/formats/month-in.sh diff --git a/tests/automake.mk b/tests/automake.mk index 36d92aeb..e5202e15 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -11,7 +11,6 @@ TESTS_ENVIRONMENT += EXEEXT=$(EXEEXT) dist_TESTS = \ tests/formats/date-in.sh \ - tests/formats/month-in.sh \ tests/formats/num-in.sh \ tests/formats/num-out.sh \ tests/formats/time-in.sh \ diff --git a/tests/data/data-in.at b/tests/data/data-in.at index 3f8acc22..e9a91bcc 100644 --- a/tests/data/data-in.at +++ b/tests/data/data-in.at @@ -202,3 +202,162 @@ AT_CHECK([cat wkday.out], [0], [dnl . . . . . . . . . @&t@ ]) AT_CLEANUP + +AT_SETUP([MONTH input format]) +AT_DATA([month.sps], [dnl +DATA LIST NOTABLE /month3 1-3 (MONTH) + month4 1-4 (MONTH) + month5 1-5 (MONTH) + month6 1-6 (MONTH) + month7 1-7 (MONTH) + month8 1-8 (MONTH) + month9 1-9 (MONTH) + month10 1-10 (MONTH). +BEGIN DATA. + +. +i +ii +iii +iiii +iv +v +vi +vii +viii +ix +viiii +x +xi +xii +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +january +JANAURY +February +fEbraury +MArch +marhc +apRIL +may +june +july +august +september +october +november +decmeber +december +END DATA. +FORMATS ALL (MONTH3). +PRINT OUTFILE='month.out'/ALL. +EXECUTE. +]) +AT_CHECK([pspp -O format=csv month.sps], [0], [dnl +month.sps:15.1-4: warning: Data for variable month4 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:15.1-5: warning: Data for variable month5 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:15.1-6: warning: Data for variable month6 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:15.1-7: warning: Data for variable month7 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:15.1-8: warning: Data for variable month8 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:15.1-9: warning: Data for variable month9 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:15.1-10: warning: Data for variable month10 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:26.1-3: warning: Data for variable month3 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:26.1-4: warning: Data for variable month4 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:26.1-5: warning: Data for variable month5 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:26.1-6: warning: Data for variable month6 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:26.1-7: warning: Data for variable month7 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:26.1-8: warning: Data for variable month8 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:26.1-9: warning: Data for variable month9 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:26.1-10: warning: Data for variable month10 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:39.1-3: warning: Data for variable month3 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:39.1-4: warning: Data for variable month4 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:39.1-5: warning: Data for variable month5 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:39.1-6: warning: Data for variable month6 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:39.1-7: warning: Data for variable month7 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:39.1-8: warning: Data for variable month8 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:39.1-9: warning: Data for variable month9 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. + +month.sps:39.1-10: warning: Data for variable month10 is not valid as format MONTH: Unrecognized month format. Months may be specified as Arabic or Roman numerals or as at least 3 letters of their English names. +]) +AT_CHECK([cat month.out], [0], [dnl + . . . . . . . . @&t@ + . . . . . . . . @&t@ + JAN JAN JAN JAN JAN JAN JAN JAN @&t@ + FEB FEB FEB FEB FEB FEB FEB FEB @&t@ + MAR MAR MAR MAR MAR MAR MAR MAR @&t@ + MAR . . . . . . . @&t@ + APR APR APR APR APR APR APR APR @&t@ + MAY MAY MAY MAY MAY MAY MAY MAY @&t@ + JUN JUN JUN JUN JUN JUN JUN JUN @&t@ + JUL JUL JUL JUL JUL JUL JUL JUL @&t@ + JUL AUG AUG AUG AUG AUG AUG AUG @&t@ + SEP SEP SEP SEP SEP SEP SEP SEP @&t@ + JUL AUG AUG AUG AUG AUG AUG AUG @&t@ + OCT OCT OCT OCT OCT OCT OCT OCT @&t@ + NOV NOV NOV NOV NOV NOV NOV NOV @&t@ + DEC DEC DEC DEC DEC DEC DEC DEC @&t@ + . . . . . . . . @&t@ + JAN JAN JAN JAN JAN JAN JAN JAN @&t@ + FEB FEB FEB FEB FEB FEB FEB FEB @&t@ + MAR MAR MAR MAR MAR MAR MAR MAR @&t@ + APR APR APR APR APR APR APR APR @&t@ + MAY MAY MAY MAY MAY MAY MAY MAY @&t@ + JUN JUN JUN JUN JUN JUN JUN JUN @&t@ + JUL JUL JUL JUL JUL JUL JUL JUL @&t@ + AUG AUG AUG AUG AUG AUG AUG AUG @&t@ + SEP SEP SEP SEP SEP SEP SEP SEP @&t@ + OCT OCT OCT OCT OCT OCT OCT OCT @&t@ + NOV NOV NOV NOV NOV NOV NOV NOV @&t@ + DEC DEC DEC DEC DEC DEC DEC DEC @&t@ + . . . . . . . . @&t@ + JAN JAN JAN JAN JAN JAN JAN JAN @&t@ + JAN JAN JAN JAN JAN JAN JAN JAN @&t@ + FEB FEB FEB FEB FEB FEB FEB FEB @&t@ + FEB FEB FEB FEB FEB FEB FEB FEB @&t@ + MAR MAR MAR MAR MAR MAR MAR MAR @&t@ + MAR MAR MAR MAR MAR MAR MAR MAR @&t@ + APR APR APR APR APR APR APR APR @&t@ + MAY MAY MAY MAY MAY MAY MAY MAY @&t@ + JUN JUN JUN JUN JUN JUN JUN JUN @&t@ + JUL JUL JUL JUL JUL JUL JUL JUL @&t@ + AUG AUG AUG AUG AUG AUG AUG AUG @&t@ + SEP SEP SEP SEP SEP SEP SEP SEP @&t@ + OCT OCT OCT OCT OCT OCT OCT OCT @&t@ + NOV NOV NOV NOV NOV NOV NOV NOV @&t@ + DEC DEC DEC DEC DEC DEC DEC DEC @&t@ + DEC DEC DEC DEC DEC DEC DEC DEC @&t@ +]) +AT_CLEANUP diff --git a/tests/formats/month-in.sh b/tests/formats/month-in.sh deleted file mode 100755 index 1627c706..00000000 --- a/tests/formats/month-in.sh +++ /dev/null @@ -1,162 +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 > month-in.pspp <