1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
17 AT_BANNER([files handling])
19 AT_SETUP([Write error - directory exists])
23 AT_DATA([file.sps], [dnl
24 DATA LIST NOTABLE/x 1.
28 SAVE OUTFILE='foobar.sav'.
31 AT_CHECK([pspp -O format=csv file.sps], [1], [dnl
32 error: Opening foobar.sav for writing: Is a directory.
34 error: Error opening `foobar.sav' for writing as a system file: Is a directory.
40 AT_SETUP([Write error - no permission])
44 touch directory/foobar.sav
48 # If we can write to the directory, then permissions just don't work
49 # properly. (Perhaps we're running as root.)
50 AT_SKIP_IF([: > directory/foo])
52 AT_DATA([file.sps], [dnl
53 DATA LIST NOTABLE/x 1.
57 SAVE OUTFILE='directory/foobar.sav'.
60 AT_CHECK([pspp -O format=csv file.sps], [1], [dnl
61 error: Creating temporary file to replace directory/foobar.sav: Permission denied.
63 error: Error opening `directory/foobar.sav' for writing as a system file: Permission denied.
72 AT_SETUP([Write error - temp file disappeared])
74 AT_DATA([file.sps], [dnl
75 DATA LIST NOTABLE/x 1.
79 XSAVE OUTFILE='foobar.sav'.
80 HOST COMMAND=[['rm foobar.savtmp*']].
84 AT_CHECK([pspp -O format=csv file.sps], [1], [ignore])
90 AT_SETUP([Write fifo])
92 dnl The Fifo feature is not available in w32 builds
95 AT_DATA([file.sps], [dnl
96 DATA LIST NOTABLE/x 1.
100 SAVE OUTFILE='foobar.sav'.
104 cat foobar.sav > /dev/null &
107 AT_CHECK([pspp -O format=csv file.sps], [0], [ignore])
113 AT_SETUP([Reading from pipe])
115 AT_DATA([pipe.sps], [dnl
116 data list file='printf "1 2\n 3 4\n 5 6\n" |' notable list /x * y *.
120 AT_CHECK([pspp -O format=csv pipe.sps], [0], [dnl
131 dnl This was seen to crash pspp
132 AT_SETUP([Reusing inline file])
134 AT_DATA([inline-reuse.sps], [dnl
135 get data /type=txt /file=inline /variables=A f7.2 .
137 data list notable list /foo.
141 data list notable list /foo.
144 AT_CHECK([pspp inline-reuse.sps], [0], [ignore])