TESTS_ENVIRONMENT += EXEEXT=$(EXEEXT)
dist_TESTS = \
- tests/command/missing-values.sh \
tests/command/no_case_size.sh \
tests/command/n_of_cases.sh \
tests/command/npar-binomial.sh \
EXTRA_DIST += \
$(dist_TESTS) \
- tests/weighting.data tests/data-list.data \
+ tests/weighting.data \
tests/no_case_size.sav \
tests/coverage.sh tests/test_template \
tests/v13.sav tests/v14.sav \
tests/language/data-io/save.at \
tests/language/data-io/save-translate.at \
tests/language/dictionary/attributes.at \
+ tests/language/dictionary/missing-values.at \
tests/language/dictionary/mrsets.at \
tests/language/expressions/evaluate.at \
tests/language/lexer/variable-parser.at \
+++ /dev/null
-#!/bin/sh
-
-# This program tests MISSING VALUES
-
-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
-
-LANG=C
-export LANG
-
-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
-
-# Copy this file --- it's shared with another test
-activity="create data"
-cp $top_srcdir/tests/data-list.data $TEMPDIR
-if [ $? -ne 0 ] ; then no_result ; fi
-
-
-activity="create program"
-cat > $TEMPDIR/missing-values.stat << foobar
-DATA LIST NOTABLE/str1 1-5 (A) str2 6-8 (A) date1 9-19 (DATE) num1 20-25
- longstr 26-36 (A).
-
-/* Valid: numeric missing values.
-MISSING VALUES date1 num1 (1).
-MISSING VALUES date1 num1 (1, 2).
-MISSING VALUES date1 num1 (1, 2, 3).
-
-/* Valid: numeric missing values using the first variable's format.
-MISSING VALUES num1 date1 ('1').
-MISSING VALUES num1 date1 ('1', '2').
-MISSING VALUES num1 date1 ('1', '2', '3').
-MISSING VALUES date1 num1 ('06-AUG-05').
-MISSING VALUES date1 num1 ('06-AUG-05', '01-OCT-78').
-MISSING VALUES date1 num1 ('06-AUG-05', '01-OCT-78', '14-FEB-81').
-
-/* Valid: ranges of numeric missing values.
-MISSING VALUES num1 (1 THRU 2).
-MISSING VALUES num1 (LO THRU 2).
-MISSING VALUES num1 (LOWEST THRU 2).
-MISSING VALUES num1 (1 THRU HI).
-MISSING VALUES num1 (1 THRU HIGHEST).
-
-/* Valid: a range of numeric missing values, plus an individual value.
-MISSING VALUES num1 (1 THRU 2, 3).
-MISSING VALUES num1 (LO THRU 2, 3).
-MISSING VALUES num1 (LOWEST THRU 2, 3).
-MISSING VALUES num1 (1 THRU HI, -1).
-MISSING VALUES num1 (1 THRU HIGHEST, -1).
-
-/* Valid: string missing values.
-MISSING VALUES str1 str2 longstr ('abc ','def').
-
-/* Invalid: too long for str2.
-MISSING VALUES str1 str2 longstr ('abcde').
-
-/* Invalid: long string missing value longer than 8 bytes.
-MISSING VALUES longstr ('abcdefghijk').
-
-/* Invalid: no string ranges.
-MISSING VALUES str1 ('a' THRU 'z').
-
-/* Invalid: mixing string and numeric variables.
-MISSING VALUES str1 num1 ('123').
-
-/* Valid: may mix variable types when clearing missing values.
-MISSING VALUES ALL ().
-
-foobar
-if [ $? -ne 0 ] ; then no_result ; fi
-
-
-activity="run program"
-$SUPERVISOR $PSPP -o pspp.csv --error-file=$TEMPDIR/errs $TEMPDIR/missing-values.stat
-# Note vv --- there are errors in input. Therefore, the command must FAIL
-if [ $? -eq 0 ] ; then fail ; fi
-
-activity="compare error messages"
-diff -u -w $TEMPDIR/errs - <<EOF
-$TEMPDIR/missing-values.stat:35: error: MISSING VALUES: Missing values provided are too long to assign to variable of width 3.
-$TEMPDIR/missing-values.stat:38: error: MISSING VALUES: Truncating missing value to maximum acceptable length (8 bytes).
-$TEMPDIR/missing-values.stat:41: error: MISSING VALUES: Syntax error at \`THRU': expecting string.
-$TEMPDIR/missing-values.stat:41: error: MISSING VALUES: THRU is not a variable name.
-$TEMPDIR/missing-values.stat:44: error: MISSING VALUES: Cannot mix numeric variables (e.g. num1) and string variables (e.g. str1) within a single list.
-EOF
-if [ $? -ne 0 ] ; then fail ; fi
-
-
-pass;
--- /dev/null
+AT_BANNER([MISSING VALUES])
+
+AT_SETUP([MISSING VALUES valid cases])
+AT_DATA([missing-values.sps], [dnl
+DATA LIST NOTABLE/str1 1-5 (A) str2 6-8 (A) date1 9-19 (DATE) num1 20-25
+ longstr 26-36 (A).
+
+* Numeric missing values.
+MISSING VALUES date1 num1 (1).
+MISSING VALUES date1 num1 (1, 2).
+MISSING VALUES date1 num1 (1, 2, 3).
+
+* Numeric missing values using the first variable's format.
+MISSING VALUES num1 date1 ('1').
+MISSING VALUES num1 date1 ('1', '2').
+MISSING VALUES num1 date1 ('1', '2', '3').
+MISSING VALUES date1 num1 ('06-AUG-05').
+MISSING VALUES date1 num1 ('06-AUG-05', '01-OCT-78').
+MISSING VALUES date1 num1 ('06-AUG-05', '01-OCT-78', '14-FEB-81').
+
+* Ranges of numeric missing values.
+MISSING VALUES num1 (1 THRU 2).
+MISSING VALUES num1 (LO THRU 2).
+MISSING VALUES num1 (LOWEST THRU 2).
+MISSING VALUES num1 (1 THRU HI).
+MISSING VALUES num1 (1 THRU HIGHEST).
+
+* A range of numeric missing values, plus an individual value.
+MISSING VALUES num1 (1 THRU 2, 3).
+MISSING VALUES num1 (LO THRU 2, 3).
+MISSING VALUES num1 (LOWEST THRU 2, 3).
+MISSING VALUES num1 (1 THRU HI, -1).
+MISSING VALUES num1 (1 THRU HIGHEST, -1).
+
+* String missing values.
+MISSING VALUES str1 str2 longstr ('abc ','def').
+
+* May mix variable types when clearing missing values.
+MISSING VALUES ALL ().
+])
+AT_CHECK([pspp -O format=csv missing-values.sps])
+AT_CLEANUP
+
+AT_SETUP([MISSING VALUES invalid cases])
+AT_DATA([missing-values.sps], [dnl
+DATA LIST NOTABLE/str1 1-5 (A) str2 6-8 (A) date1 9-19 (DATE) num1 20-25
+ longstr 26-36 (A).
+
+* Too long for str2.
+MISSING VALUES str1 str2 longstr ('abcde').
+
+* Long string missing value longer than 8 bytes.
+MISSING VALUES longstr ('abcdefghijk').
+
+* No string ranges.
+MISSING VALUES str1 ('a' THRU 'z').
+
+* Mixing string and numeric variables.
+MISSING VALUES str1 num1 ('123').
+])
+AT_CHECK([pspp -O format=csv missing-values.sps], [1], [dnl
+missing-values.sps:5: error: MISSING VALUES: Missing values provided are too long to assign to variable of width 3.
+
+missing-values.sps:8: error: MISSING VALUES: Truncating missing value to maximum acceptable length (8 bytes).
+
+missing-values.sps:11: error: MISSING VALUES: Syntax error at `THRU': expecting string.
+
+missing-values.sps:11: error: MISSING VALUES: THRU is not a variable name.
+
+missing-values.sps:14: error: MISSING VALUES: Cannot mix numeric variables (e.g. num1) and string variables (e.g. str1) within a single list.
+])
+AT_CLEANUP