From: Ben Pfaff Date: Sat, 2 Oct 2010 21:29:37 +0000 (-0700) Subject: tests: Convert no_case_size.sh test to Autotest framework. X-Git-Tag: v0.7.6~120 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3907c90636062a3bd63788a2ca453e81ffdebf7;p=pspp-builds.git tests: Convert no_case_size.sh test to Autotest framework. --- diff --git a/tests/automake.mk b/tests/automake.mk index 9170f9d3..e02e090b 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/no_case_size.sh \ tests/command/n_of_cases.sh \ tests/command/npar-binomial.sh \ tests/command/npar-chisquare.sh \ @@ -300,7 +299,6 @@ tests_output_render_test_LDADD = \ EXTRA_DIST += \ $(dist_TESTS) \ tests/weighting.data \ - tests/no_case_size.sav \ tests/coverage.sh tests/test_template \ tests/v13.sav tests/v14.sav \ tests/expressions/randist/beta.out \ @@ -357,6 +355,7 @@ EXTRA_DIST += \ TESTSUITE_AT = \ tests/data/calendar.at \ tests/data/data-in.at \ + tests/data/sys-file.at \ tests/language/command.at \ tests/language/control/do-if.at \ tests/language/control/do-repeat.at \ diff --git a/tests/command/no_case_size.sh b/tests/command/no_case_size.sh deleted file mode 100755 index a03c617b..00000000 --- a/tests/command/no_case_size.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/sh - -# This program tests that system files can be read properly, even when the -# case_size header value is -1 (Some 3rd party products do this) - - -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 -GET FILE='$top_srcdir/tests/no_case_size.sav'. -DISPLAY DICTIONARY. -LIST. -EOF -if [ $? -ne 0 ] ; then no_result ; fi - - -activity="run program" -$SUPERVISOR $PSPP -o pspp.csv $TESTFILE -if [ $? -ne 0 ] ; then no_result ; fi - -activity="compare output" -diff -c pspp.csv - < cont2.sav], [0], [], [ignore]) +AT_CHECK([cmp cont.sav cont2.sav], [1], + [cont.sav cont2.sav differ: char 69, line 1 +]) + +AT_DATA([get.sps], [dnl +GET FILE='cont2.sav'. +DISPLAY LABELS. +LIST. +]) +AT_CHECK([pspp -o pspp.csv get.sps]) +AT_CHECK([cat pspp.csv], [0], [dnl +Variable,Label,,Position +cont,continents of the world,,1 +size,sq km,,2 +pop,population,,3 +count,number of countries,,4 + +Table: Data List +cont,size,pop,count +Asia ,44579000,3.7E+009,44.00 +Africa ,30065000,7.8E+008,53.00 +North America ,24256000,4.8E+008,23.00 +South America ,17819000,3.4E+008,12.00 +Antarctica ,13209000,.00,.00 +Europe ,9938000,7.3E+008,46.00 +Australia/Oceania ,7687000,31000000,14.00 +]) +AT_CLEANUP diff --git a/tests/no_case_size.sav b/tests/no_case_size.sav deleted file mode 100644 index d338212e..00000000 Binary files a/tests/no_case_size.sav and /dev/null differ