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/>.
19 m4_define([LOOP_DATA], [dnl
20 data list notable /x 1 y 2 z 3.
29 AT_SETUP([LOOP with index])
30 AT_DATA([loop.sps], [dnl
38 AT_CHECK([pspp -o pspp.csv loop.sps])
39 AT_CHECK([cat pspp.csv], [0], [dnl
54 AT_SETUP([LOOP with IF condition])
55 AT_DATA([loop.sps], [dnl
65 AT_CHECK([pspp -o pspp.csv loop.sps])
66 AT_CHECK([cat pspp.csv], [0], [dnl
81 AT_SETUP([LOOP with END IF condition])
82 AT_DATA([loop.sps], [dnl
92 AT_CHECK([pspp -o pspp.csv loop.sps])
93 AT_CHECK([cat pspp.csv], [0], [dnl
109 AT_SETUP([LOOP with index and IF based on index])
110 AT_DATA([loop.sps], [dnl
112 loop #m=x to y by z if #m < 4.
118 AT_CHECK([pspp -o pspp.csv loop.sps])
119 AT_CHECK([cat pspp.csv], [0], [dnl
131 AT_SETUP([LOOP with index and END IF based on index])
132 AT_DATA([loop.sps], [dnl
140 AT_CHECK([pspp -o pspp.csv loop.sps])
141 AT_CHECK([cat pspp.csv], [0], [dnl
155 AT_SETUP([LOOP with index and IF and END IF based on index])
156 AT_DATA([loop.sps], [dnl
158 loop #o=x to y by z if mod(#o,2) = 0.
164 AT_CHECK([pspp -o pspp.csv loop.sps])
165 AT_CHECK([cat pspp.csv], [0], [dnl
175 AT_SETUP([LOOP with no conditions containing BREAK])
176 AT_DATA([loop.sps], [dnl
189 AT_CHECK([pspp -o pspp.csv loop.sps])
190 AT_CHECK([cat pspp.csv], [0], [dnl
204 AT_SETUP([LOOP with no conditions that ends due to MXLOOPS])
205 AT_DATA([loop.sps], [dnl
215 AT_CHECK([pspp -o pspp.csv loop.sps])
216 AT_CHECK([cat pspp.csv], [0], [dnl
232 AT_SETUP([LOOP with IF condition that ends due to MXLOOPS])
233 AT_DATA([loop.sps], [dnl
244 AT_CHECK([pspp -o pspp.csv loop.sps])
245 AT_CHECK([cat pspp.csv], [0], [dnl