From 4452f196b0027dd0fec0a09c275c9907b6a296bb Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 17 Dec 2003 05:39:14 +0000 Subject: [PATCH] Added a test for the compute command. --- src/Makefile.am | 4 +- tests/Makefile.am | 3 +- tests/command/compute.sh | 95 ++++++++++++++++++++++++++++++++++++++++ tests/compute.stat | 22 ---------- 4 files changed, 99 insertions(+), 25 deletions(-) create mode 100755 tests/command/compute.sh delete mode 100644 tests/compute.stat diff --git a/src/Makefile.am b/src/Makefile.am index 005ae685..4b833261 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,7 +8,7 @@ pkgsysconfdir = $(sysconfdir)/@PACKAGE@ bin_PROGRAMS = pspp -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/lib \ +AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/lib \ -I$(top_srcdir)/intl DISTCLEANFILES = foo $(q_sources_c) @@ -47,7 +47,7 @@ stats.c stats.h str.c str.h sysfile-info.c tab.c tab.h temporary.c \ title.c t-test.c val-labs.c var-labs.c var.h vars-atr.c vars-prs.c \ vector.c vector.h version.c version.h vfm.c vfm.h vfmP.h weight.c -LDADD = ../lib/julcal/libjulcal.a \ +pspp_LDADD = ../lib/julcal/libjulcal.a \ ../lib/misc/libmisc.a \ ../lib/dcdflib/libdcdflib.a \ @LIBINTL@ diff --git a/tests/Makefile.am b/tests/Makefile.am index d064145a..4c9f3f64 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -6,6 +6,7 @@ TESTS = command/aggregate.sh \ command/beg-data.sh \ command/bignum.sh \ command/count.sh \ + command/compute.sh \ command/descriptives.sh \ command/file-label.sh \ command/flip.sh \ @@ -28,7 +29,7 @@ sort.data: gengarbage$(EXTEXT) ./gengarbage | head -1000 > $@ EXTRA_DIST = \ -compute.stat crosstabs.stat data-fmts.stat \ +crosstabs.stat data-fmts.stat \ data-list.data do-if.stat do-repeat.stat \ expr.stat filter.stat gengarbage.c \ inpt-pgm.stat list.data mtch-file.stat \ diff --git a/tests/command/compute.sh b/tests/command/compute.sh new file mode 100755 index 00000000..0e3655ce --- /dev/null +++ b/tests/command/compute.sh @@ -0,0 +1,95 @@ +#!/bin/sh + +# This program tests the COMPUTE command +# (it also gives LPAD and RPAD a work out) + +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/compute.stat <