From 5bae7045326ba7e3294c29b2bfe56acd4b4b26ec Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 17 Dec 2003 06:03:19 +0000 Subject: [PATCH] Added a test for the WEIGHT command --- tests/Makefile.am | 1 + tests/command/weight.sh | 167 ++++++++++++++++++++++++++++++++++++ tests/expect/weighting.stat | 1 - tests/weighting.stat | 8 -- 4 files changed, 168 insertions(+), 9 deletions(-) create mode 100755 tests/command/weight.sh delete mode 100644 tests/expect/weighting.stat delete mode 100644 tests/weighting.stat diff --git a/tests/Makefile.am b/tests/Makefile.am index 4c9f3f64..201a1946 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -18,6 +18,7 @@ TESTS = command/aggregate.sh \ command/sort.sh \ command/tabs.sh \ command/split-file.sh \ + command/weight.sh \ bugs/double-frequency.sh \ bugs/html-frequency.sh \ bugs/crosstabs.sh diff --git a/tests/command/weight.sh b/tests/command/weight.sh new file mode 100755 index 00000000..35bbaa77 --- /dev/null +++ b/tests/command/weight.sh @@ -0,0 +1,167 @@ +#!/bin/sh + +# This program tests .... + +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/weight.stat <