From b996647adb40b2b51f888c8e755d5f5f2c15cb37 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 21 Mar 2004 03:17:32 +0000 Subject: [PATCH] Add stub for USE ALL. --- TODO | 4 +- src/Makefile.am | 2 +- src/command.def | 1 + tests/Makefile.am | 1 + tests/command/use.sh | 92 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 96 insertions(+), 4 deletions(-) create mode 100755 tests/command/use.sh diff --git a/TODO b/TODO index f3c4a46b..147f526a 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,8 @@ -Time-stamp: <2004-03-20 10:33:19 blp> +Time-stamp: <2004-03-20 19:16:04 blp> TODO ---- -Write DATE, USE. - There needs to be another layer onto the lexer, which should probably be entirely rewritten anyway. The lexer needs to read entire *commands* at a time, not just a *line* at a time. It also needs to support arbitrary putback, diff --git a/src/Makefile.am b/src/Makefile.am index 3c777378..b0c2e2ac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,7 +39,7 @@ apply-dict.c ascii.c autorecode.c bitvector.h \ cmdline.c cmdline.h command.c command.def command.h compute.c \ copyleft.c copyleft.h \ count.c data-in.c data-in.h data-list.c data-list.h \ -data-out.c debug.c debug-print.h devind.c devind.h dfm.c dfm.h \ +data-out.c date.c debug.c debug-print.h devind.c devind.h dfm.c dfm.h \ dictionary.c do-if.c do-ifP.h error.c error.h expr-evl.c expr-opt.c \ expr-prs.c expr.h exprP.h file-handle.h file-type.c \ filename.c filename.h flip.c font.h format.c format.def format.h \ diff --git a/src/command.def b/src/command.def index a6f4610b..b5a3eda1 100644 --- a/src/command.def +++ b/src/command.def @@ -125,6 +125,7 @@ DEFCMD ("TEMPORARY", ERRO, ERRO, TRAN, TRAN, cmd_temporary) SPCCMD ("TITLE", INIT, INPU, TRAN, PROC, cmd_title) DEFCMD ("T-TEST", ERRO, ERRO, PROC, PROC, cmd_t_test) UNIMPL ("UPDATE", TRAN, ERRO, TRAN, TRAN) +DEFCMD ("USE", ERRO, ERRO, TRAN, TRAN, cmd_use) DEFCMD ("VALUE LABELS", ERRO, INPU, TRAN, TRAN, cmd_value_labels) DEFCMD ("VARIABLE LABELS", ERRO, INPU, TRAN, TRAN, cmd_variable_labels) UNIMPL ("VARSTOCASES", ERRO, ERRO, PROC, PROC) diff --git a/tests/Makefile.am b/tests/Makefile.am index 32d838aa..60ffbaeb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -31,6 +31,7 @@ TESTS = command/aggregate.sh \ command/t-test-1-sample-missing-anal.sh \ command/t-test-indep-missing-list.sh \ command/t-test-indep-missing-anal.sh \ + command/use.sh \ command/weight.sh \ bugs/alpha-freq.sh \ bugs/compute-fmt.sh \ diff --git a/tests/command/use.sh b/tests/command/use.sh new file mode 100755 index 00000000..2afcc939 --- /dev/null +++ b/tests/command/use.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +# This program tests USE, just to make sure that USE ALL is accepted silently. + +TEMPDIR=/tmp/pspp-tst-$$ + +here=`pwd`; + +# ensure that top_srcdir is absolute +cd $top_srcdir; top_srcdir=`pwd` + +export STAT_CONFIG_PATH=$top_srcdir/config + + +cleanup() +{ + 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 + +activity="create program" +cat > $TEMPDIR/filter.stat << EOF +data list notable /x 1-2. +begin data. +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +end data. +use all. +list. + +EOF +if [ $? -ne 0 ] ; then no_result ; fi + + +activity="run program" +$SUPERVISOR $here/../src/pspp --testing-mode -o raw-ascii $TEMPDIR/filter.stat +if [ $? -ne 0 ] ; then no_result ; fi + + +activity="check results" +diff -B -b $TEMPDIR/pspp.list - << EOF + X +-- + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +EOF +if [ $? -ne 0 ] ; then fail ; fi + +pass; -- 2.30.2