From: John Darrington Date: Tue, 16 Dec 2003 08:59:04 +0000 (+0000) Subject: Added new tests X-Git-Tag: v0.4.0~440 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b26094b483f97d89025df65a30523a65e716790a;p=pspp-builds.git Added new tests --- 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 <