From 90cc746da3d96887772567a1dbff2a81efb17b21 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 10 Oct 2010 22:16:44 -0700 Subject: [PATCH] datasheet: Convert tests to Autotest framework. --- tests/atlocal.in | 1 + tests/automake.mk | 4 ++-- tests/data/datasheet-test.at | 16 ++++++++++++++++ tests/data/datasheet-test.sh | 14 -------------- 4 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 tests/data/datasheet-test.at delete mode 100755 tests/data/datasheet-test.sh diff --git a/tests/atlocal.in b/tests/atlocal.in index 7bd713cd..159bfe57 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -7,6 +7,7 @@ host='@host@' GNM_SUPPORT='@GNM_SUPPORT@' GZIP= export GZIP +EXEEXT='@EXEEXT@' PSQL_SUPPORT='@PSQL_SUPPORT@' if test "$PSQL_SUPPORT" = yes; then diff --git a/tests/automake.mk b/tests/automake.mk index 362baaa7..7b1e4cb8 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -27,7 +27,6 @@ dist_TESTS = \ tests/formats/wkday-in.sh \ tests/formats/wkday-out.sh \ tests/formats/360.sh \ - tests/data/datasheet-test.sh \ tests/libpspp/sparse-xarray-test.sh \ tests/output/paper-size.sh \ tests/expressions/randist.sh \ @@ -286,6 +285,7 @@ EXTRA_DIST += \ TESTSUITE_AT = \ tests/data/calendar.at \ tests/data/data-in.at \ + tests/data/datasheet-test.at \ tests/data/por-file.at \ tests/data/sys-file.at \ tests/language/command.at \ @@ -386,7 +386,7 @@ EXTRA_DIST += tests/testsuite.at CHECK_LOCAL += tests_check tests_check: tests/atconfig tests/atlocal $(TESTSUITE) $(check_PROGRAMS) - $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=tests/libpspp:tests/output:src/ui/terminal $(TESTSUITEFLAGS) + $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=tests/data:tests/libpspp:tests/output:src/ui/terminal $(TESTSUITEFLAGS) CLEAN_LOCAL += tests_clean tests_clean: diff --git a/tests/data/datasheet-test.at b/tests/data/datasheet-test.at new file mode 100644 index 00000000..06f4ae52 --- /dev/null +++ b/tests/data/datasheet-test.at @@ -0,0 +1,16 @@ +AT_BANNER([datasheet]) + +m4_define([DATASHEET_TEST], + [AT_SETUP([$1x$2, $3 backing rows, backing widths $4]) + AT_KEYWORDS([datasheet]) + AT_CHECK( + [datasheet-test$EXEEXT --verbosity=0 --max-rows=$1 --max-columns=$2 \ + --backing-rows=$3 --backing-widths=$4], + [0], [ignore], [ignore]) + AT_CLEANUP]) + +DATASHEET_TEST([3], [3], [0], []) +DATASHEET_TEST([3], [3], [3], [0,0,0]) +DATASHEET_TEST([3], [3], [3], [0]) +DATASHEET_TEST([3], [3], [3], [5]) +DATASHEET_TEST([3], [3], [1], [0,9,0]) diff --git a/tests/data/datasheet-test.sh b/tests/data/datasheet-test.sh deleted file mode 100755 index 41630b10..00000000 --- a/tests/data/datasheet-test.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# This program tests the datasheet implementation. - -set -e - -: ${top_builddir:=.} -RUN_TEST="${top_builddir}/tests/data/datasheet-test$EXEEXT --verbosity=0" - -$RUN_TEST --max-rows=3 --max-columns=3 --backing-rows=0 --backing-widths= -$RUN_TEST --max-rows=3 --max-columns=3 --backing-rows=3 --backing-widths=0,0,0 -$RUN_TEST --max-rows=3 --max-columns=3 --backing-rows=3 --backing-widths=0 -$RUN_TEST --max-rows=3 --max-columns=3 --backing-rows=3 --backing-widths=5 -$RUN_TEST --max-rows=3 --max-columns=3 --backing-rows=1 --backing-widths=0,9,0 -- 2.30.2