projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: Convert GET DATA /TYPE=TXT tests to use Autotest.
[pspp]
/
tests
/
command
/
insert.sh
diff --git
a/tests/command/insert.sh
b/tests/command/insert.sh
index ba4f543a790e6e595455271974aa3ed5b237b8fc..4bcb96fedc2330c319c69ed82faa3d632be39cea 100755
(executable)
--- a/
tests/command/insert.sh
+++ b/
tests/command/insert.sh
@@
-2,7
+2,8
@@
# This program tests the INSERT command
# This program tests the INSERT command
-TEMPDIR=/tmp/pspp-tst-$$
+BASETEMPDIR=/tmp/pspp-tst-$$
+TEMPDIR=$BASETEMPDIR/link
TESTFILE=$TEMPDIR/`basename $0`.sps
# ensure that top_srcdir and top_builddir are absolute
TESTFILE=$TEMPDIR/`basename $0`.sps
# ensure that top_srcdir and top_builddir are absolute
@@
-11,7
+12,7
@@
if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
top_srcdir=`cd $top_srcdir; pwd`
top_builddir=`cd $top_builddir; pwd`
top_srcdir=`cd $top_srcdir; pwd`
top_builddir=`cd $top_builddir; pwd`
-PSPP=$top_builddir/src/ui/terminal/pspp
+PSPP=$top_builddir/src/ui/terminal/pspp
$EXEEXT
STAT_CONFIG_PATH=$top_srcdir/config
export STAT_CONFIG_PATH
STAT_CONFIG_PATH=$top_srcdir/config
export STAT_CONFIG_PATH
@@
-23,10
+24,11
@@
export LANG
cleanup()
{
if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
cleanup()
{
if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
- echo "NOT cleaning $TEMPDIR"
+ echo "NOT cleaning $
BASE
TEMPDIR"
return ;
fi
return ;
fi
- rm -rf $TEMPDIR
+ cd /
+ rm -rf $BASETEMPDIR
}
}
@@
-53,7
+55,9
@@
pass()
exit 0;
}
exit 0;
}
-mkdir -p $TEMPDIR
+mkdir -p $BASETEMPDIR/target
+
+ln -s $BASETEMPDIR/target $TEMPDIR
cd $TEMPDIR
cd $TEMPDIR
@@
-88,7
+92,7
@@
if [ $? -ne 0 ] ; then no_result ; fi
#This command should fail
activity="run program 1"
#This command should fail
activity="run program 1"
-$SUPERVISOR $PSPP -
-testing-mode -o raw-ascii
$TESTFILE > /dev/null
+$SUPERVISOR $PSPP -
o pspp.csv
$TESTFILE > /dev/null
if [ $? -eq 0 ] ; then fail ; fi
if [ $? -eq 0 ] ; then fail ; fi
@@
-106,7
+110,7
@@
EOF
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program 2"
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program 2"
-$SUPERVISOR $PSPP -
-testing-mode -o raw-ascii
$TESTFILE
+$SUPERVISOR $PSPP -
o pspp.csv
$TESTFILE
if [ $? -ne 0 ] ; then fail ; fi
if [ $? -ne 0 ] ; then fail ; fi
@@
-154,7
+158,7
@@
if [ $? -ne 0 ] ; then no_result ; fi
# This command should fail
activity="run program 3"
# This command should fail
activity="run program 3"
-$SUPERVISOR $PSPP -
-testing-mode -o raw-ascii
$TESTFILE > /dev/null
+$SUPERVISOR $PSPP -
o pspp.csv
$TESTFILE > /dev/null
if [ $? -eq 0 ] ; then fail ; fi
activity="create wrapper 6"
if [ $? -eq 0 ] ; then fail ; fi
activity="create wrapper 6"
@@
-170,7
+174,7
@@
EOF
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program 4"
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program 4"
-$SUPERVISOR $PSPP -
-testing-mode -o raw-ascii
$TESTFILE
+$SUPERVISOR $PSPP -
o pspp.csv
$TESTFILE
if [ $? -ne 0 ] ; then fail ; fi
if [ $? -ne 0 ] ; then fail ; fi
@@
-206,15
+210,16
@@
EOF
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program 5"
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program 5"
-$SUPERVISOR $PSPP -
-testing-mode -o raw-ascii
$TESTFILE > /dev/null
+$SUPERVISOR $PSPP -
o pspp.csv
$TESTFILE > /dev/null
if [ $? -ne 1 ] ; then no_result ; fi
activity="examine output 1"
if [ $? -ne 1 ] ; then no_result ; fi
activity="examine output 1"
-diff
$TEMPDIR/pspp.list
- <<EOF
+diff
-c $TEMPDIR/pspp.csv
- <<EOF
$TEMPDIR/foo.sps:10: error: DISPLAY: AKSDJ is not a variable name.
$TEMPDIR/foo.sps:10: error: DISPLAY: AKSDJ is not a variable name.
+
warning: Error encountered while ERROR=STOP is effective.
warning: Error encountered while ERROR=STOP is effective.
-$TEMPDIR/foo.sps:10: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
+$TEMPDIR/foo.sps:10: error: Stopping syntax file processing here to avoid a cascade of dependent command failures.
EOF
if [ $? -ne 0 ] ; then fail ; fi
EOF
if [ $? -ne 0 ] ; then fail ; fi
@@
-232,22
+237,38
@@
EOF
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program 6"
if [ $? -ne 0 ] ; then no_result ; fi
activity="run program 6"
-$SUPERVISOR $PSPP -
-testing-mode -o raw-ascii
$TESTFILE > /dev/null
+$SUPERVISOR $PSPP -
o pspp.csv
$TESTFILE > /dev/null
if [ $? -ne 1 ] ; then no_result ; fi
activity="examine output 2"
if [ $? -ne 1 ] ; then no_result ; fi
activity="examine output 2"
-diff $TEMPDIR/pspp.
list
- <<EOF
+diff $TEMPDIR/pspp.
csv
- <<EOF
$TEMPDIR/foo.sps:10: error: DISPLAY: AKSDJ is not a variable name.
$TEMPDIR/foo.sps:10: error: DISPLAY: AKSDJ is not a variable name.
- x
---------
- 1.00
- 2.00
- 3.00
-
+Table: Data List
+x
+1.00
+2.00
+3.00
EOF
if [ $? -ne 0 ] ; then fail ; fi
EOF
if [ $? -ne 0 ] ; then fail ; fi
+# Test for regression against bug #24569 in which PSPP crashed
+# upon attempt to insert a nonexistent file.
+activity="create wrapper 9"
+cat <<EOF > $TESTFILE
+INSERT
+ FILE='$TEMPDIR/nonexistent'
+ ERROR=CONTINUE.
+ .
+
+LIST.
+EOF
+if [ $? -ne 0 ] ; then no_result ; fi
+
+#This command should fail
+activity="run program 7"
+$SUPERVISOR $PSPP -o pspp.csv $TESTFILE > /dev/null
+if [ $? -eq 0 ] ; then no_result ; fi
pass;
pass;