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)
25 AT_DATA([charts.sps],[
28 compute x = rv.normal (56, 3) + rv.uniform (1, 1).
29 compute y = rv.normal (6, 2) + rv.uniform (1, 2).
30 compute A = rv.uniform (-1, 1).
38 /plot = histogram, npplot spreadlevel(1)
52 AT_CHECK([pspp -o pspp.txt charts.sps], [0], [ignore])
58 data list list /fred * group * w *.
95 compute bert = fred + (group < 0.5) * 45.
96 compute charlie = fred + (group > 0.5) * 15.
99 ROC /fred bert charlie by group (0)
100 /plot = curve (reference).
104 AT_CHECK([pspp -o pspp.txt roc.sps], [0], [ignore])
112 AT_DATA([scree.sps],[
117 compute vec(#v) = rv.normal (0, 45).
120 compute vec(#v) = vec (#v - 3) + rv.normal (0, 30).
128 factor /variables = all
134 AT_CHECK([pspp -o pspp.txt scree.sps], [0], [ignore])
139 AT_SETUP([Histogram])
140 AT_DATA([histogram.sps],[
141 * This test is designed to "torture" the code which
142 generates histograms. It is no-crash test. However
143 the code is rich in assertions, so any problems we
144 hope will be caught there.
149 compute pos = rv.normal (56, 3) + rv.uniform (1, 1).
150 compute neg = rv.normal (-86, 2) + rv.uniform (1, 1).
151 compute pn = rv.normal (0, 2) + rv.uniform (1, 2).
152 compute A = rv.uniform (-1, 1).
160 examine pos neg pn by a
164 frequencies pos neg pn
170 dnl The --testing-mode flag is important!!
171 AT_CHECK([pspp --testing-mode -o pspp.txt histogram.sps], [0], [ignore])
176 AT_SETUP([FREQUENCIES charts])
178 DATA LIST LIST /nationality (A10) religion (A20) gender (A8).
184 British Zoroastrian Female
185 British Buddist Female
186 British Buddist Female
187 British Zoroastrian Female
189 German Christian Male
190 German Christian Female
191 German Christian Male
192 German Zoroastrian Female
195 German Pastafarian Female
196 German "Jedi Knight" Female
200 French Christian Male
204 FREQUENCIES /VARIABLES=religion nationality /BARCHART /PIECHART.
208 AT_CHECK([pspp -o pspp.txt xxx.sps], [0], [ignore])
214 AT_SETUP([CROSSTABS charts])
216 DATA LIST LIST /nationality (A10) religion (A20) gender (A8).
222 British Zoroastrian Female
223 British Buddist Female
224 British Buddist Female
225 British Zoroastrian Female
227 German Christian Male
228 German Christian Female
229 German Christian Male
230 German Zoroastrian Female
233 German Pastafarian Female
234 German "Jedi Knight" Female
238 French Christian Male
243 /tables = nationality by religion by gender
244 /tables = nationality by religion
245 /tables = religion by gender
246 /tables = nationality by religion by gender
251 AT_CHECK([pspp -o pspp.txt xxx.sps], [0], [ignore])
258 AT_SETUP([BOXPLOT Empty])
260 DATA LIST LIST /X * Y * .
275 AT_CHECK([pspp -o pspp.txt bp.sps], [0], [ignore])