From b26094b483f97d89025df65a30523a65e716790a Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 16 Dec 2003 08:59:04 +0000 Subject: [PATCH] Added new tests --- tests/command/lag.sh | 90 ++++++++++++++ tests/command/print.sh | 232 ++++++++++++++++++++++++++++++++++++ tests/command/sample.sh | 79 ++++++++++++ tests/command/split-file.sh | 106 ++++++++++++++++ tests/command/tabs.sh | 84 +++++++++++++ 5 files changed, 591 insertions(+) create mode 100755 tests/command/lag.sh create mode 100755 tests/command/print.sh create mode 100755 tests/command/sample.sh create mode 100755 tests/command/split-file.sh create mode 100755 tests/command/tabs.sh diff --git a/tests/command/lag.sh b/tests/command/lag.sh new file mode 100755 index 00000000..db7c2969 --- /dev/null +++ b/tests/command/lag.sh @@ -0,0 +1,90 @@ +#!/bin/sh + +# This program tests the LAG function + +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/lag.stat < $TEMPFILE/print.stat < $TEMPDIR/errs +# Note vv --- there are errors in input. Therefore, the command must FAIL +if [ $? -eq 0 ] ; then fail ; fi + +activity="compare error messages" +diff -w $TEMPDIR/errs - < $TEMPDIR/sample.stat < $TEMPDIR/split.stat < $TEMPDIR/tabs.stat <> $TEMPDIR/tabs.stat +if [ $? -ne 0 ] ; then no_result ; fi + + +activity="create program 3" +cat >> $TEMPDIR/tabs.stat <