Add copyright and licence notices to files which lack them
[pspp] / tests / utilities / pspp-output.at
1 dnl Copyright (C) 2020  Free Software Foundation
2
3 dnl This program is free software: you can redistribute it and/or modify
4 dnl it under the terms of the GNU General Public License as published by
5 dnl the Free Software Foundation, either version 3 of the License, or
6 dnl (at your option) any later version.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
10 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 dnl GNU General Public License for more details.
12
13 dnl You should have received a copy of the GNU General Public License
14 dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16 AT_BANNER([pspp-output])
17
18 AT_SETUP([pspp-output dir])
19 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv], [0], [dnl
20 - heading "Set" command "Set"
21 - heading "Title" command "Title"
22     - text "Page Title" command "Title"
23 - heading "Data List" command "Data List"
24     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
25 - heading "Begin Data" command "Begin Data"
26 - heading "List" command "List"
27     - table "Data List" command "List"
28 - heading "Frequencies" command "Frequencies"
29     - table "Statistics" command "Frequencies"
30     - table "v0" command "Frequencies" subtype "Frequencies"
31     - table "v1" command "Frequencies" subtype "Frequencies"
32     - table "v2" command "Frequencies" subtype "Frequencies"
33 - heading "Regression" command "Regression"
34     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
35     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
36     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
37 ])
38 AT_CLEANUP
39
40 AT_SETUP([pspp-output --select equal])
41 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --select=headings],
42   [0], [dnl
43 - heading "Set" command "Set"
44 - heading "Title" command "Title"
45 - heading "Data List" command "Data List"
46 - heading "Begin Data" command "Begin Data"
47 - heading "List" command "List"
48 - heading "Frequencies" command "Frequencies"
49 - heading "Regression" command "Regression"
50 ])
51 AT_CLEANUP
52
53 AT_SETUP([pspp-output --select unequal])
54 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --select=^headings],
55   [0], [dnl
56     - text "Page Title" command "Title"
57     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
58     - table "Data List" command "List"
59     - table "Statistics" command "Frequencies"
60     - table "v0" command "Frequencies" subtype "Frequencies"
61     - table "v1" command "Frequencies" subtype "Frequencies"
62     - table "v2" command "Frequencies" subtype "Frequencies"
63     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
64     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
65     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
66 ])
67 AT_CLEANUP
68
69 AT_SETUP([pspp-output --commands equal])
70 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --commands='reg*'],
71   [0], [dnl
72 - heading "Regression" command "Regression"
73     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
74     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
75     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
76 ])
77 AT_CLEANUP
78
79 AT_SETUP([pspp-output --commands unequal])
80 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --commands='^reg*'],
81   [0], [dnl
82 - heading "Set" command "Set"
83 - heading "Title" command "Title"
84     - text "Page Title" command "Title"
85 - heading "Data List" command "Data List"
86     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
87 - heading "Begin Data" command "Begin Data"
88 - heading "List" command "List"
89     - table "Data List" command "List"
90 - heading "Frequencies" command "Frequencies"
91     - table "Statistics" command "Frequencies"
92     - table "v0" command "Frequencies" subtype "Frequencies"
93     - table "v1" command "Frequencies" subtype "Frequencies"
94     - table "v2" command "Frequencies" subtype "Frequencies"
95 ])
96 AT_CLEANUP
97
98 AT_SETUP([pspp-output --nth-commands])
99 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --nth-commands=2,4,6],
100   [0], [dnl
101 - heading "Title" command "Title"
102     - text "Page Title" command "Title"
103 - heading "Begin Data" command "Begin Data"
104 - heading "Frequencies" command "Frequencies"
105     - table "Statistics" command "Frequencies"
106     - table "v0" command "Frequencies" subtype "Frequencies"
107     - table "v1" command "Frequencies" subtype "Frequencies"
108     - table "v2" command "Frequencies" subtype "Frequencies"
109 ])
110 AT_CLEANUP
111
112 AT_SETUP([pspp-output --subtypes equal])
113 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --subtypes='freq*'],
114   [0], [dnl
115     - table "v0" command "Frequencies" subtype "Frequencies"
116     - table "v1" command "Frequencies" subtype "Frequencies"
117     - table "v2" command "Frequencies" subtype "Frequencies"
118 ])
119 AT_CLEANUP
120
121 AT_SETUP([pspp-output --subtypes unequal])
122 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --subtypes='^freq*'],
123   [0], [dnl
124 - heading "Set" command "Set"
125 - heading "Title" command "Title"
126     - text "Page Title" command "Title"
127 - heading "Data List" command "Data List"
128     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
129 - heading "Begin Data" command "Begin Data"
130 - heading "List" command "List"
131     - table "Data List" command "List"
132 - heading "Frequencies" command "Frequencies"
133     - table "Statistics" command "Frequencies"
134 - heading "Regression" command "Regression"
135     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
136     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
137     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
138 ])
139 AT_CLEANUP
140
141 AT_SETUP([pspp-output --labels equal])
142 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --labels='v*'],
143   [0], [dnl
144     - table "v0" command "Frequencies" subtype "Frequencies"
145     - table "v1" command "Frequencies" subtype "Frequencies"
146     - table "v2" command "Frequencies" subtype "Frequencies"
147 ])
148 AT_CLEANUP
149
150 AT_SETUP([pspp-output --labels unequal])
151 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --labels='^data*'],
152   [0], [dnl
153 - heading "Set" command "Set"
154 - heading "Title" command "Title"
155     - text "Page Title" command "Title"
156     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
157 - heading "Begin Data" command "Begin Data"
158 - heading "List" command "List"
159 - heading "Frequencies" command "Frequencies"
160     - table "Statistics" command "Frequencies"
161     - table "v0" command "Frequencies" subtype "Frequencies"
162     - table "v1" command "Frequencies" subtype "Frequencies"
163     - table "v2" command "Frequencies" subtype "Frequencies"
164 - heading "Regression" command "Regression"
165     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
166     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
167     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
168 ])
169 AT_CLEANUP
170
171 AT_SETUP([pspp-output --instances])
172 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --instances=1],
173   [0], [dnl
174     - text "Page Title" command "Title"
175     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
176     - table "Data List" command "List"
177     - table "Statistics" command "Frequencies"
178     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
179 ])
180 AT_CLEANUP
181
182 AT_SETUP([pspp-output --instances=last])
183 AT_KEYWORDS([--instances last])
184 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --instances=last],
185   [0], [dnl
186     - text "Page Title" command "Title"
187     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
188     - table "Data List" command "List"
189     - table "v2" command "Frequencies" subtype "Frequencies"
190     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
191 ])
192 AT_CLEANUP
193
194 dnl XXX Currently PSPP doesn't output hidden items so no tests
195 dnl XXX for --show-hidden.
196
197 AT_SETUP([pspp-output --or])
198 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --select=headings --or --labels='v*'],
199   [0], [dnl
200 - heading "Set" command "Set"
201 - heading "Title" command "Title"
202 - heading "Data List" command "Data List"
203 - heading "Begin Data" command "Begin Data"
204 - heading "List" command "List"
205 - heading "Frequencies" command "Frequencies"
206     - table "v0" command "Frequencies" subtype "Frequencies"
207     - table "v1" command "Frequencies" subtype "Frequencies"
208     - table "v2" command "Frequencies" subtype "Frequencies"
209 - heading "Regression" command "Regression"
210 ])
211 AT_CLEANUP
212
213 AT_SETUP([pspp-output convert])
214 AT_CHECK([pspp-output convert $srcdir/utilities/regress.spv -O format=csv - --subtypes='model*'], [0], [dnl
215 Table: Model Summary (v2)
216 R,R Square,Adjusted R Square,Std. Error of the Estimate
217 .96,.92,.91,1.49
218 ])
219 AT_CLEANUP