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([CHARTS Rudimentary run tests])
18 dnl Check that the charts work
19 dnl Currently, "work" means that the commands which
20 dnl should generate them, run without crashing.
21 dnl Better tests will come later (hopefully)
24 AT_DATA([charts.sps],[
27 compute x = rv.normal (56, 3) + rv.uniform (1, 1).
28 compute y = rv.normal (6, 2) + rv.uniform (1, 2).
29 compute A = rv.uniform (-1, 1).
37 /plot = histogram, npplot spreadlevel(1)
51 AT_CHECK([pspp -o pspp.txt charts.sps], [0], [ignore])
57 data list list /fred * group * w *.
94 compute bert = fred + (group < 0.5) * 45.
95 compute charlie = fred + (group > 0.5) * 15.
98 ROC /fred bert charlie by group (0)
99 /plot = curve (reference).
103 AT_CHECK([pspp -o pspp.txt roc.sps], [0], [ignore])
111 AT_DATA([scree.sps],[
116 compute vec(#v) = rv.normal (0, 45).
119 compute vec(#v) = vec (#v - 3) + rv.normal (0, 30).
127 factor /variables = all
133 AT_CHECK([pspp -o pspp.txt scree.sps], [0], [ignore])
138 AT_SETUP([Histogram])
139 AT_DATA([histogram.sps],[
140 * This test is designed to "torture" the code which
141 generates histograms. It is no-crash test. However
142 the code is rich in assertions, so any problems we
143 hope will be caught there.
148 compute pos = rv.normal (56, 3) + rv.uniform (1, 1).
149 compute neg = rv.normal (-86, 2) + rv.uniform (1, 1).
150 compute pn = rv.normal (0, 2) + rv.uniform (1, 2).
151 compute A = rv.uniform (-1, 1).
159 examine pos neg pn by a
163 frequencies pos neg pn
169 dnl The --testing-mode flag is important!!
170 AT_CHECK([pspp --testing-mode -o pspp.txt histogram.sps], [0], [ignore])
175 AT_SETUP([FREQUENCIES charts])
177 DATA LIST LIST /nationality (A10) religion (A20) gender (A8).
183 British Zoroastrian Female
184 British Buddist Female
185 British Buddist Female
186 British Zoroastrian Female
188 German Christian Male
189 German Christian Female
190 German Christian Male
191 German Zoroastrian Female
194 German Pastafarian Female
195 German "Jedi Knight" Female
199 French Christian Male
203 FREQUENCIES /VARIABLES=religion nationality /BARCHART /PIECHART.
207 AT_CHECK([pspp -o pspp.txt xxx.sps], [0], [ignore])
213 AT_SETUP([CROSSTABS charts])
215 DATA LIST LIST /nationality (A10) religion (A20) gender (A8).
221 British Zoroastrian Female
222 British Buddist Female
223 British Buddist Female
224 British Zoroastrian Female
226 German Christian Male
227 German Christian Female
228 German Christian Male
229 German Zoroastrian Female
232 German Pastafarian Female
233 German "Jedi Knight" Female
237 French Christian Male
242 /tables = nationality by religion by gender
243 /tables = nationality by religion
244 /tables = religion by gender
245 /tables = nationality by religion by gender
250 AT_CHECK([pspp -o pspp.txt xxx.sps], [0], [ignore])
257 AT_SETUP([BOXPLOT Empty])
259 DATA LIST LIST /X * Y * .
274 AT_CHECK([pspp -o pspp.txt bp.sps], [0], [ignore])