1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017, 2020 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 m4_define([CHECK_UPDATE],
17 [AT_SETUP([UPDATE $1 with $2])
18 AT_DATA([a.data], [dnl
33 AT_DATA([b.data], [dnl
42 [AT_DATA([save-a.sps], [dnl
43 DATA LIST NOTABLE FILE='a.data' /a b c 1-3 (A).
46 AT_CHECK([pspp -O format=csv save-a.sps])])
48 [AT_DATA([save-b.sps], [dnl
49 DATA LIST NOTABLE FILE='b.data' /a b c 1-3 (A).
52 AT_CHECK([pspp -O format=csv save-b.sps])])
53 AT_DATA([update.sps], [dnl
54 m4_if([$1], [sav], [], [DATA LIST NOTABLE FILE='a.data' /a b c 1-3 (A).])
55 m4_if([$2], [sav], [], [DATA LIST NOTABLE FILE='b.data' /a b c 1-3 (A).])
57 m4_if([$1], [sav], [FILE='a.sav'], [FILE=*]) /IN=InA /SORT
58 m4_if([$2], [sav], [FILE='b.sav'], [FILE=*]) /IN=InB /RENAME c=d
63 AT_CHECK([pspp -O format=csv update.sps], [0], [dnl
64 update.sps:6: warning: UPDATE: Encountered 3 sets of duplicate cases in the master file.
88 CHECK_UPDATE([sav], [sav])
89 CHECK_UPDATE([sav], [inline])
90 CHECK_UPDATE([inline], [sav])
93 AT_SETUP([SAVE RENAME with TO])
94 AT_DATA([save-rename-to.sps], [dnl
95 data list notable list /a b c fxo9*.
100 SAVE OUTFILE = "renamed.sav"
101 /RENAME=(A B C = fdo9 TO fdo11).
105 GET FILE = "renamed.sav".
109 AT_CHECK([pspp -O format=csv save-rename-to.sps], [0], [dnl
111 fdo9,fdo10,fdo11,fxo9