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/>.
16 dnl AT_BANNER([portable files])
18 AT_SETUP([overwriting portable file])
19 AT_DATA([output.por], [abcdef
21 cp output.por output.por.backup
22 AT_DATA([porfile.sps], [dnl
23 DATA LIST NOTABLE/x 1.
27 EXPORT OUTFILE='output.por'.
29 AT_CHECK([pspp -O format=csv porfile.sps])
30 AT_CHECK([cmp output.por output.por.backup], [1], [ignore])
33 AT_SETUP([overwriting portable file atomically])
34 AT_DATA([output.por], [abcdef
36 cp output.por output.por.backup
37 AT_DATA([porfile.sps],
38 [[DATA LIST NOTABLE/x 1.
42 XEXPORT OUTFILE='output.por'.
43 HOST COMMAND=['kill -TERM $PPID'].
45 AT_CHECK([pspp -O format=csv porfile.sps], [143], [], [ignore])
46 AT_CHECK([cmp output.por output.por.backup])
48 [for file in *.tmp*; do if test -e $file; then echo $file; exit 1; fi; done])
51 AT_SETUP([write to same portable file being read])
52 AT_DATA([export.sps], [dnl
53 DATA LIST NOTABLE/x 1.
57 EXPORT OUTFILE='data.por'.
59 AT_CHECK([pspp -O format=csv export.sps])
60 AT_CHECK([test -s data.por])
62 [for file in *.tmp*; do if test -e $file; then echo $file; exit 1; fi; done])
63 AT_DATA([export2.sps], [dnl
64 IMPORT FILE='data.por'.
66 EXPORT OUTFILE='data.por'.
68 AT_CHECK([pspp -O format=csv export2.sps])
70 [for file in *.tmp*; do if test -e $file; then echo $file; exit 1; fi; done])
71 AT_DATA([export3.sps], [dnl
72 IMPORT FILE='data.por'.
75 AT_CHECK([pspp -O format=csv export3.sps], [0], [dnl
82 dnl This checks for a bug in the portable file writer that caused an infinite
83 dnl loop in some cases, and other problems in other cases, when a variable
85 AT_SETUP([write portable file with value labels])
86 AT_DATA([export.sps], [dnl
87 DATA LIST NOTABLE/var1 TO var5 1-5.
97 EXPORT OUTFILE='data.por'.
99 AT_CHECK([pspp -O format=csv export.sps])
100 AT_DATA([import.sps], [dnl
101 IMPORT FILE='data.por'.
105 AT_CHECK([pspp -O format=csv import.sps], [0], [dnl
106 Variable,Description,Position
129 VAR1,VAR2,VAR3,VAR4,VAR5
132 AT_DATA([sys-file-info.sps], [SYSFILE INFO FILE='data.por'
134 AT_CHECK([pspp -O format=csv sys-file-info.sps | sed '/Encoding/d
144 Type:,SPSS Portable File
145 Weight:,Not weighted.
148 Variable,Description,Position
152 Display Alignment: Right
160 Display Alignment: Right
168 Display Alignment: Right
176 Display Alignment: Right
184 Display Alignment: Right