Add stub for USE ALL.
authorBen Pfaff <blp@gnu.org>
Sun, 21 Mar 2004 03:17:32 +0000 (03:17 +0000)
committerBen Pfaff <blp@gnu.org>
Sun, 21 Mar 2004 03:17:32 +0000 (03:17 +0000)
TODO
src/Makefile.am
src/command.def
tests/Makefile.am
tests/command/use.sh [new file with mode: 0755]

diff --git a/TODO b/TODO
index f3c4a46b3f83d38175a182a20a542bb4ea11c936..147f526a4bc9b56e9074c179a04e6ceb637577b9 100644 (file)
--- 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,
index 3c7773785797e5e843d6c5558b73fcd8b0f378b8..b0c2e2acdadcab8a01bdbaf05d6161acf2d4b519 100644 (file)
@@ -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       \
index a6f4610b19722e3cf1de12cc0a7395fedb1997d4..b5a3eda1d412c6d845195dd43e3ccfcfc465660d 100644 (file)
@@ -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)
index 32d838aa2b409f377474e73b9c5660f1c8ad050e..60ffbaeb29dfb52021240b480d7c9fcdca9b923e 100644 (file)
@@ -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 (executable)
index 0000000..2afcc93
--- /dev/null
@@ -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;