EXTRA_DIST += tests/testsuite.at
+# Generate a TableLook that prints all layers of pivot tables.
+check_DATA = tests/all-layers.stt
+tests/all-layers.stt: utilities/pspp-output
+ $(AM_V_GEN)$< get-table-look - $@.tmp
+ $(AM_V_at)if grep 'printAllLayers="false"' $@.tmp >/dev/null; then :; else \
+ echo >&2 "$<: expected printAllLayers=\"false\""; exit 1; fi
+ $(AM_v_at)sed 's/printAllLayers="false"/printAllLayers="true"/' < $@.tmp > $@
+
CHECK_LOCAL += tests_check
-tests_check: tests/atconfig tests/atlocal $(TESTSUITE) $(check_PROGRAMS)
+tests_check: tests/atconfig tests/atlocal $(TESTSUITE) $(check_PROGRAMS) $(check_DATA)
XTERM_LOCALE='' $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) RUNNER='$(RUNNER)' $(TESTSUITEFLAGS)
CLEAN_LOCAL += tests_clean
dnl Features not yet tested:
dnl - Preprocessing to distinguish categorical from scale.
dnl - Testing details of missing value handling in summaries.
-dnl - test CLABELS ROWLABELS=LAYER.
dnl - Test VLABELS.
dnl - Test WEIGHT and adjustment weights.
dnl - Summary functions:
AT_CHECK([ln $top_srcdir/examples/nhtsa.sav . || cp $top_srcdir/examples/nhtsa.sav .])
AT_DATA([ctables.sps],
[[GET 'nhtsa.sav'.
+CTABLES /TABLE AgeGroup BY qns3a.
CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=OPPOSITE.
CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=OPPOSITE.
+CTABLES /TABLE AgeGroup BY qns3a /CLABELS ROWLABELS=LAYER.
+CTABLES /TABLE AgeGroup BY qns3a /CLABELS COLLABELS=LAYER.
]])
-AT_CHECK([pspp ctables.sps -O box=unicode -O width=120], [0], [dnl
+pwd
+AT_CHECK([pspp ctables.sps --table-look="$builddir"/all-layers.stt -O box=unicode -O width=120], [0], [dnl
+ Custom Tables
+╭───────────────────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├─────┬──────┤
+│ │ Male│Female│
+│ ├─────┼──────┤
+│ │Count│ Count│
+├───────────────────────┼─────┼──────┤
+│Age group 15 or younger│ 0│ 0│
+│ 16 to 25 │ 594│ 505│
+│ 26 to 35 │ 476│ 491│
+│ 36 to 45 │ 489│ 548│
+│ 46 to 55 │ 526│ 649│
+│ 56 to 65 │ 516│ 731│
+│ 66 or older │ 531│ 943│
+╰───────────────────────┴─────┴──────╯
+
Custom Tables
╭───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │ S3a. GENDER: │
│ 66 or older Male │ 531│
│ Female│ 943│
╰──────────────────────────────┴────────────╯
+
+ Custom Tables
+15 or younger
+╭─────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├─────┬──────┤
+│ │ Male│Female│
+│ ├─────┼──────┤
+│ │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│ 0│ 0│
+╰─────────┴─────┴──────╯
+
+ Custom Tables
+16 to 25
+╭─────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├─────┬──────┤
+│ │ Male│Female│
+│ ├─────┼──────┤
+│ │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│ 594│ 505│
+╰─────────┴─────┴──────╯
+
+ Custom Tables
+26 to 35
+╭─────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├─────┬──────┤
+│ │ Male│Female│
+│ ├─────┼──────┤
+│ │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│ 476│ 491│
+╰─────────┴─────┴──────╯
+
+ Custom Tables
+36 to 45
+╭─────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├─────┬──────┤
+│ │ Male│Female│
+│ ├─────┼──────┤
+│ │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│ 489│ 548│
+╰─────────┴─────┴──────╯
+
+ Custom Tables
+46 to 55
+╭─────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├─────┬──────┤
+│ │ Male│Female│
+│ ├─────┼──────┤
+│ │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│ 526│ 649│
+╰─────────┴─────┴──────╯
+
+ Custom Tables
+56 to 65
+╭─────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├─────┬──────┤
+│ │ Male│Female│
+│ ├─────┼──────┤
+│ │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│ 516│ 731│
+╰─────────┴─────┴──────╯
+
+ Custom Tables
+66 or older
+╭─────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├─────┬──────┤
+│ │ Male│Female│
+│ ├─────┼──────┤
+│ │Count│ Count│
+├─────────┼─────┼──────┤
+│Age group│ 531│ 943│
+╰─────────┴─────┴──────╯
+
+ Custom Tables
+Male
+╭───────────────────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├────────────┤
+│ │ Count │
+├───────────────────────┼────────────┤
+│Age group 15 or younger│ 0│
+│ 16 to 25 │ 594│
+│ 26 to 35 │ 476│
+│ 36 to 45 │ 489│
+│ 46 to 55 │ 526│
+│ 56 to 65 │ 516│
+│ 66 or older │ 531│
+╰───────────────────────┴────────────╯
+
+ Custom Tables
+Female
+╭───────────────────────┬────────────╮
+│ │S3a. GENDER:│
+│ ├────────────┤
+│ │ Count │
+├───────────────────────┼────────────┤
+│Age group 15 or younger│ 0│
+│ 16 to 25 │ 505│
+│ 26 to 35 │ 491│
+│ 36 to 45 │ 548│
+│ 46 to 55 │ 649│
+│ 56 to 65 │ 731│
+│ 66 or older │ 943│
+╰───────────────────────┴────────────╯
])
AT_CLEANUP