From fc4cd1371a6aa4b74901998c046f76801b5a85b1 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 12 Oct 2010 20:49:15 -0700 Subject: [PATCH] data-out: Convert tests for binary and hex formats to Autotest framework. --- tests/automake.mk | 2 +- .../{formats => data}/binhex-out.expected.gz | Bin .../binhex-out.sh => data/data-out.at} | 83 ++++-------------- 3 files changed, 18 insertions(+), 67 deletions(-) rename tests/{formats => data}/binhex-out.expected.gz (100%) rename tests/{formats/binhex-out.sh => data/data-out.at} (54%) mode change 100755 => 100644 diff --git a/tests/automake.mk b/tests/automake.mk index 70ff67cc..53dcdf0a 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/formats/binhex-out.sh \ tests/formats/date-in.sh \ tests/formats/date-out.sh \ tests/formats/float-format.sh \ @@ -262,6 +261,7 @@ EXTRA_DIST += \ TESTSUITE_AT = \ tests/data/calendar.at \ tests/data/data-in.at \ + tests/data/data-out.at \ tests/data/datasheet-test.at \ tests/data/por-file.at \ tests/data/sys-file.at \ diff --git a/tests/formats/binhex-out.expected.gz b/tests/data/binhex-out.expected.gz similarity index 100% rename from tests/formats/binhex-out.expected.gz rename to tests/data/binhex-out.expected.gz diff --git a/tests/formats/binhex-out.sh b/tests/data/data-out.at old mode 100755 new mode 100644 similarity index 54% rename from tests/formats/binhex-out.sh rename to tests/data/data-out.at index 04e0cdc0..95f60d59 --- a/tests/formats/binhex-out.sh +++ b/tests/data/data-out.at @@ -1,50 +1,12 @@ -#! /bin/sh +AT_BANNER([data output (data-out)]) -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 > binhex-out.pspp < expected.out -if [ $? -ne 0 ] ; then no_result ; fi - -activity="compare output" -cmp expected.out binhex.out -if [ $? -ne 0 ] ; then fail ; fi - -pass +EXECUTE. +]) +AT_CHECK([pspp -O format=csv binhex-out.sps]) +AT_CHECK([gzip -cd < $top_srcdir/tests/data/binhex-out.expected.gz > expout]) +AT_CHECK([cat binhex.out], [0], [expout]) +AT_CLEANUP -- 2.30.2