3 # This program tests that simultaneous input and output to a single
4 # file properly coexist, with the output atomically replacing the
7 TEMPDIR=/tmp/pspp-tst-$$
8 TESTFILE=$TEMPDIR/`basename $0`.sps
10 # ensure that top_builddir are absolute
11 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
12 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
13 top_builddir=`cd $top_builddir; pwd`
14 PSPP=$top_builddir/src/ui/terminal/pspp
16 # ensure that top_srcdir is absolute
17 top_srcdir=`cd $top_srcdir; pwd`
19 STAT_CONFIG_PATH=$top_srcdir/config
20 export STAT_CONFIG_PATH
25 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
26 echo "NOT cleaning $TEMPDIR"
61 # This test only works on systems that have a /dev/null device...
62 test -c /dev/null || no_result
64 # ...and that are able to make a symbolic link to it...
65 ln -s /dev/null foo.out || no_result
67 # ...that is still /dev/null.
68 test -c /dev/null || no_result
70 activity="create program 1"
80 PRINT OUTFILE='foo.out'/x.
81 PRINT OUTFILE='foo2.out'/x.
84 if [ $? -ne 0 ] ; then no_result ; fi
86 activity="run program 1"
87 $SUPERVISOR $PSPP --testing-mode $TESTFILE
88 if [ $? -ne 0 ] ; then no_result ; fi
90 activity="check that foo2.out was created"
91 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
92 diff -b foo2.out - << EOF
99 if [ $? -ne 0 ] ; then fail ; fi
101 activity="check that foo.out is unchanged"
102 test -c /dev/null || fail