From a3907c90636062a3bd63788a2ca453e81ffdebf7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 2 Oct 2010 14:29:37 -0700 Subject: [PATCH] tests: Convert no_case_size.sh test to Autotest framework. --- tests/automake.mk | 3 +- tests/command/no_case_size.sh | 111 ---------------------------------- tests/data/sys-file.at | 60 ++++++++++++++++++ tests/no_case_size.sav | Bin 872 -> 0 bytes 4 files changed, 61 insertions(+), 113 deletions(-) delete mode 100755 tests/command/no_case_size.sh create mode 100644 tests/data/sys-file.at delete mode 100644 tests/no_case_size.sav 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 d338212e6f195e999e10d5959a71aac48eab4c38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 872 zcmb`Ezfaph6vtiK2-J3~1nWaEBvO^sgdb9-J3)ei5Q%Ck)T&kG7^7GucjkPC1*9;r zbn43AK*v^HISHQ5Z$#J4%>B^hIN;N8_-b1vtZ4Y^|*mGJ!cy3LOYv=m_K% z=&lcYQuQ`r*efDN`B^$gx{o{=4|^LKD_9gx^G%)n3z&;`V4I$fYLWhA+pRXC@ECKU z4C7w*-v8zoTd%TWi5yRGb1?pCpYrUa^4)NQ6}Bdo?gH=o21lOU zlN34YVsekT)AYx;+;@RFGQQ0locO^;8WJ}+?0nAoBI824%F|gd)Nf{vMUb<;*g?+G z%BUVI8TtUU`f%Cd#y-jV|N8SR=a(6eBdy$C;8t3m?+Wu6<~^+Qm+vy}?Z*S2Tp3^U Hea>zGw$srj -- 2.30.2