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 m4_define([CHECK_ADD_FILES],
17 [AT_SETUP([ADD FILES -- $1 $2 with $3])
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 m4_if([$1], [interleave],
54 [m4_pushdef([BY], [[/BY a /FIRST=first /LAST=last]])
55 m4_pushdef([SORT], [[/SORT]])],
57 m4_pushdef([SORT], [])])
58 AT_DATA([add-files.sps], [dnl
59 m4_if([$2], [sav], [], [DATA LIST NOTABLE FILE='a.data' /a b c 1-3 (A).])
60 m4_if([$3], [sav], [], [DATA LIST NOTABLE FILE='b.data' /a b c 1-3 (A).])
62 m4_if([$2], [sav], [FILE='a.sav'], [FILE=*]) /IN=InA SORT
63 m4_if([$3], [sav], [FILE='b.sav'], [FILE=*]) /IN=InB /RENAME c=d
69 AT_CHECK([pspp -O format=csv add-files.sps], [0],
70 [m4_if([$1], [interleave], [dnl
72 a,b,c,d,InA,InB,first,last
118 AT_BANNER([ADD FILES])
120 CHECK_ADD_FILES([interleave], [sav], [sav])
121 CHECK_ADD_FILES([interleave], [sav], [inline])
122 CHECK_ADD_FILES([interleave], [inline], [sav])
123 CHECK_ADD_FILES([concatenate], [sav], [sav])
124 CHECK_ADD_FILES([concatenate], [sav], [inline])
125 CHECK_ADD_FILES([concatenate], [inline], [sav])