datasheet: Convert tests to Autotest framework.
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 11 Oct 2010 05:16:44 +0000 (22:16 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 11 Oct 2010 05:16:44 +0000 (22:16 -0700)
tests/atlocal.in
tests/automake.mk
tests/data/datasheet-test.at [new file with mode: 0644]
tests/data/datasheet-test.sh [deleted file]

index 7bd713cdd2be0654985e24d884aed77241a6ef86..159bfe57d9f3fdcac5f23ddea1500af552120236 100644 (file)
@@ -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
index 362baaa7b59addcba745aa93bb8898d7a4c7f695..7b1e4cb82425a5ced716baf6d2ad61b3be3aa845 100644 (file)
@@ -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 (file)
index 0000000..06f4ae5
--- /dev/null
@@ -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 (executable)
index 41630b1..0000000
+++ /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