pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/tests automake.mk command/datasheet.sh [simpler-proc]


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/tests automake.mk command/datasheet.sh [simpler-proc]
Date: Sat, 14 Apr 2007 23:04:00 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Branch:         simpler-proc
Changes by:     Ben Pfaff <blp> 07/04/14 23:04:00

Modified files:
        tests          : automake.mk 
Added files:
        tests/command  : datasheet.sh 

Log message:
        Add test.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/tests/automake.mk?cvsroot=pspp&only_with_tag=simpler-proc&r1=1.27.2.9&r2=1.27.2.10
http://cvs.savannah.gnu.org/viewcvs/pspp/tests/command/datasheet.sh?cvsroot=pspp&only_with_tag=simpler-proc&rev=1.1.2.1

Patches:
Index: automake.mk
===================================================================
RCS file: /cvsroot/pspp/pspp/tests/automake.mk,v
retrieving revision 1.27.2.9
retrieving revision 1.27.2.10
diff -u -b -r1.27.2.9 -r1.27.2.10
--- automake.mk 2 Apr 2007 13:53:49 -0000       1.27.2.9
+++ automake.mk 14 Apr 2007 23:04:00 -0000      1.27.2.10
@@ -8,6 +8,7 @@
        tests/command/beg-data.sh \
        tests/command/bignum.sh \
        tests/command/count.sh \
+       tests/command/datasheet.sh \
        tests/command/data-list.sh \
        tests/command/do-repeat.sh \
        tests/command/erase.sh \

Index: command/datasheet.sh
===================================================================
RCS file: command/datasheet.sh
diff -N command/datasheet.sh
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ command/datasheet.sh        14 Apr 2007 23:04:00 -0000      1.1.2.1
@@ -0,0 +1,80 @@
+#!/bin/sh
+
+# This program tests datasheet support.
+
+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
+
+# 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()
+{
+     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
+
+activity="Create File 1"
+cat > $TESTFILE <<EOF
+debug datasheet max=3,3 backing=0,0/progress=none/output=file("/dev/null").
+debug datasheet max=3,3 backing=3,3/progress=none/output=file("/dev/null").
+debug datasheet max=3,3 backing=3,1/progress=none/output=file("/dev/null").
+debug datasheet max=3,3 backing=1,3/progress=none/output=file("/dev/null").
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+
+activity="Run pspp 1"
+$SUPERVISOR $PSPP --testing-mode $TESTFILE > datasheet.out
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="compare results"
+diff -b  $TEMPDIR/datasheet.out - <<EOF
+Datasheet test max(3,3) backing(0,0) successful.
+Datasheet test max(3,3) backing(3,3) successful.
+Datasheet test max(3,3) backing(3,1) successful.
+Datasheet test max(3,3) backing(1,3) successful.
+EOF
+if [ $? -ne 0 ] ; then fail ; fi
+
+pass;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]