Greatly simplify PSPP configuration.
[pspp-builds.git] / tests / command / insert.sh
index be7f9e08c565c52677a4e0704f92acd86b84a948..0d8f1697aa36ee1fb6950dfcf4b94728f7fac10e 100755 (executable)
@@ -92,7 +92,7 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 #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
 
 
@@ -110,7 +110,7 @@ EOF
 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
 
 
@@ -158,7 +158,7 @@ if [ $? -ne 0 ] ; then no_result ; fi
 
 # 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"
@@ -174,7 +174,7 @@ EOF
 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
 
 
@@ -210,15 +210,16 @@ EOF
 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"
-diff $TEMPDIR/pspp.list - <<EOF
+diff -c $TEMPDIR/pspp.csv - <<EOF
 $TEMPDIR/foo.sps:10: error: DISPLAY: AKSDJ is not a variable name.
+
 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
 
@@ -236,20 +237,38 @@ EOF
 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"
-diff $TEMPDIR/pspp.list - <<EOF
+diff $TEMPDIR/pspp.csv - <<EOF
 $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
 
+# 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;