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([CHARTS Rudimentary run tests])
19 dnl Check that the charts work
20 dnl Currently, "work" means that the commands which
21 dnl should generate them, run without crashing.
22 dnl Better tests will come later (hopefully)
26 AT_DATA([charts.sps],[
29 compute x = rv.normal (56, 3) + rv.uniform (1, 1).
30 compute y = rv.normal (6, 2) + rv.uniform (1, 2).
31 compute A = rv.uniform (-1, 1).
39 /plot = histogram, npplot spreadlevel(1)
53 AT_CHECK([pspp -o pspp.txt charts.sps], [0], [ignore])
59 data list list /fred * group * w *.
96 compute bert = fred + (group < 0.5) * 45.
97 compute charlie = fred + (group > 0.5) * 15.
100 ROC /fred bert charlie by group (0)
101 /plot = curve (reference).
105 AT_CHECK([pspp -o pspp.txt roc.sps], [0], [ignore])
113 AT_DATA([scree.sps],[
118 compute vec(#v) = rv.normal (0, 45).
121 compute vec(#v) = vec (#v - 3) + rv.normal (0, 30).
129 factor /variables = all
135 AT_CHECK([pspp -o pspp.txt scree.sps], [0], [ignore])
140 AT_SETUP([Histogram])
141 AT_DATA([histogram.sps],[
142 * This test is designed to "torture" the code which
143 generates histograms. It is no-crash test. However
144 the code is rich in assertions, so any problems we
145 hope will be caught there.
150 compute pos = rv.normal (56, 3) + rv.uniform (1, 1).
151 compute neg = rv.normal (-86, 2) + rv.uniform (1, 1).
152 compute pn = rv.normal (0, 2) + rv.uniform (1, 2).
153 compute A = rv.uniform (-1, 1).
161 examine pos neg pn by a
165 frequencies pos neg pn
171 dnl The --testing-mode flag is important!!
172 AT_CHECK([pspp --testing-mode -o pspp.txt histogram.sps], [0], [ignore])
177 AT_SETUP([FREQUENCIES charts])
179 DATA LIST LIST /nationality (A10) religion (A20) gender (A8).
185 British Zoroastrian Female
186 British Buddist Female
187 British Buddist Female
188 British Zoroastrian Female
190 German Christian Male
191 German Christian Female
192 German Christian Male
193 German Zoroastrian Female
196 German Pastafarian Female
197 German "Jedi Knight" Female
201 French Christian Male
205 FREQUENCIES /VARIABLES=religion nationality /BARCHART /PIECHART.
209 AT_CHECK([pspp -o pspp.txt xxx.sps], [0], [ignore])
215 AT_SETUP([CROSSTABS charts])
217 DATA LIST LIST /nationality (A10) religion (A20) gender (A8).
223 British Zoroastrian Female
224 British Buddist Female
225 British Buddist Female
226 British Zoroastrian Female
228 German Christian Male
229 German Christian Female
230 German Christian Male
231 German Zoroastrian Female
234 German Pastafarian Female
235 German "Jedi Knight" Female
239 French Christian Male
244 /tables = nationality by religion by gender
245 /tables = nationality by religion
246 /tables = religion by gender
247 /tables = nationality by religion by gender
252 AT_CHECK([pspp -o pspp.txt xxx.sps], [0], [ignore])
259 AT_SETUP([BOXPLOT Empty])
261 DATA LIST LIST /X * Y * .
276 AT_CHECK([pspp -o pspp.txt bp.sps], [0], [ignore])