From 743a9ef8927b6b9347eafaa9e32caca1871a14c4 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 5 May 2005 13:16:28 +0000 Subject: [PATCH] Fix PR 12948. --- tests/bugs/match-files-scratch.sh | 92 +++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100755 tests/bugs/match-files-scratch.sh diff --git a/tests/bugs/match-files-scratch.sh b/tests/bugs/match-files-scratch.sh new file mode 100755 index 00000000..afdea8a9 --- /dev/null +++ b/tests/bugs/match-files-scratch.sh @@ -0,0 +1,92 @@ +#!/bin/sh + +# This program tests for a bug which caused MATCH FILES to crash +# when used with scratch variables. + + +TEMPDIR=/tmp/pspp-tst-$$ +TESTFILE=$TEMPDIR/`basename $0`.pspp + +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 > $TESTFILE <