pspp-output: Add new --nth-commands option.
[pspp] / tests / utilities / pspp-output.at
1 AT_BANNER([pspp-output])
2
3 AT_SETUP([pspp-output dir])
4 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv], [0], [dnl
5 - heading "Set" command "Set"
6 - heading "Title" command "Title"
7     - text "Page Title" command "Title"
8 - heading "Data List" command "Data List"
9     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
10 - heading "Begin Data" command "Begin Data"
11 - heading "List" command "List"
12     - table "Data List" command "List"
13 - heading "Frequencies" command "Frequencies"
14     - table "Statistics" command "Frequencies"
15     - table "v0" command "Frequencies" subtype "Frequencies"
16     - table "v1" command "Frequencies" subtype "Frequencies"
17     - table "v2" command "Frequencies" subtype "Frequencies"
18 - heading "Regression" command "Regression"
19     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
20     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
21     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
22 ])
23 AT_CLEANUP
24
25 AT_SETUP([pspp-output --select equal])
26 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --select=headings],
27   [0], [dnl
28 - heading "Set" command "Set"
29 - heading "Title" command "Title"
30 - heading "Data List" command "Data List"
31 - heading "Begin Data" command "Begin Data"
32 - heading "List" command "List"
33 - heading "Frequencies" command "Frequencies"
34 - heading "Regression" command "Regression"
35 ])
36 AT_CLEANUP
37
38 AT_SETUP([pspp-output --select unequal])
39 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --select=^headings],
40   [0], [dnl
41     - text "Page Title" command "Title"
42     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
43     - table "Data List" command "List"
44     - table "Statistics" command "Frequencies"
45     - table "v0" command "Frequencies" subtype "Frequencies"
46     - table "v1" command "Frequencies" subtype "Frequencies"
47     - table "v2" command "Frequencies" subtype "Frequencies"
48     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
49     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
50     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
51 ])
52 AT_CLEANUP
53
54 AT_SETUP([pspp-output --commands equal])
55 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --commands='reg*'],
56   [0], [dnl
57 - heading "Regression" command "Regression"
58     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
59     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
60     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
61 ])
62 AT_CLEANUP
63
64 AT_SETUP([pspp-output --commands unequal])
65 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --commands='^reg*'],
66   [0], [dnl
67 - heading "Set" command "Set"
68 - heading "Title" command "Title"
69     - text "Page Title" command "Title"
70 - heading "Data List" command "Data List"
71     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
72 - heading "Begin Data" command "Begin Data"
73 - heading "List" command "List"
74     - table "Data List" command "List"
75 - heading "Frequencies" command "Frequencies"
76     - table "Statistics" command "Frequencies"
77     - table "v0" command "Frequencies" subtype "Frequencies"
78     - table "v1" command "Frequencies" subtype "Frequencies"
79     - table "v2" command "Frequencies" subtype "Frequencies"
80 ])
81 AT_CLEANUP
82
83 AT_SETUP([pspp-output --nth-commands])
84 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --nth-commands=2,4,6],
85   [0], [dnl
86 - heading "Title" command "Title"
87     - text "Page Title" command "Title"
88 - heading "Begin Data" command "Begin Data"
89 - heading "Frequencies" command "Frequencies"
90     - table "Statistics" command "Frequencies"
91     - table "v0" command "Frequencies" subtype "Frequencies"
92     - table "v1" command "Frequencies" subtype "Frequencies"
93     - table "v2" command "Frequencies" subtype "Frequencies"
94 ])
95 AT_CLEANUP
96
97 AT_SETUP([pspp-output --subtypes equal])
98 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --subtypes='freq*'],
99   [0], [dnl
100     - table "v0" command "Frequencies" subtype "Frequencies"
101     - table "v1" command "Frequencies" subtype "Frequencies"
102     - table "v2" command "Frequencies" subtype "Frequencies"
103 ])
104 AT_CLEANUP
105
106 AT_SETUP([pspp-output --subtypes unequal])
107 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --subtypes='^freq*'],
108   [0], [dnl
109 - heading "Set" command "Set"
110 - heading "Title" command "Title"
111     - text "Page Title" command "Title"
112 - heading "Data List" command "Data List"
113     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
114 - heading "Begin Data" command "Begin Data"
115 - heading "List" command "List"
116     - table "Data List" command "List"
117 - heading "Frequencies" command "Frequencies"
118     - table "Statistics" command "Frequencies"
119 - heading "Regression" command "Regression"
120     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
121     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
122     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
123 ])
124 AT_CLEANUP
125
126 AT_SETUP([pspp-output --labels equal])
127 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --labels='v*'],
128   [0], [dnl
129     - table "v0" command "Frequencies" subtype "Frequencies"
130     - table "v1" command "Frequencies" subtype "Frequencies"
131     - table "v2" command "Frequencies" subtype "Frequencies"
132 ])
133 AT_CLEANUP
134
135 AT_SETUP([pspp-output --labels unequal])
136 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --labels='^data*'],
137   [0], [dnl
138 - heading "Set" command "Set"
139 - heading "Title" command "Title"
140     - text "Page Title" command "Title"
141     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
142 - heading "Begin Data" command "Begin Data"
143 - heading "List" command "List"
144 - heading "Frequencies" command "Frequencies"
145     - table "Statistics" command "Frequencies"
146     - table "v0" command "Frequencies" subtype "Frequencies"
147     - table "v1" command "Frequencies" subtype "Frequencies"
148     - table "v2" command "Frequencies" subtype "Frequencies"
149 - heading "Regression" command "Regression"
150     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
151     - table "ANOVA (v2)" command "Regression" subtype "ANOVA"
152     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
153 ])
154 AT_CLEANUP
155
156 AT_SETUP([pspp-output --instances])
157 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --instances=1],
158   [0], [dnl
159     - text "Page Title" command "Title"
160     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
161     - table "Data List" command "List"
162     - table "Statistics" command "Frequencies"
163     - table "Model Summary (v2)" command "Regression" subtype "Model Summary"
164 ])
165 AT_CLEANUP
166
167 AT_SETUP([pspp-output --instances=last])
168 AT_KEYWORDS([--instances last])
169 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --instances=last],
170   [0], [dnl
171     - text "Page Title" command "Title"
172     - table "Reading 1 record from INLINE." command "Data List" subtype "Fixed Data Records"
173     - table "Data List" command "List"
174     - table "v2" command "Frequencies" subtype "Frequencies"
175     - table "Coefficients (v2)" command "Regression" subtype "Coefficients"
176 ])
177 AT_CLEANUP
178
179 dnl XXX Currently PSPP doesn't output hidden items so no tests
180 dnl XXX for --show-hidden.
181
182 AT_SETUP([pspp-output --or])
183 AT_CHECK([pspp-output dir $srcdir/utilities/regress.spv --select=headings --or --labels='v*'],
184   [0], [dnl
185 - heading "Set" command "Set"
186 - heading "Title" command "Title"
187 - heading "Data List" command "Data List"
188 - heading "Begin Data" command "Begin Data"
189 - heading "List" command "List"
190 - heading "Frequencies" command "Frequencies"
191     - table "v0" command "Frequencies" subtype "Frequencies"
192     - table "v1" command "Frequencies" subtype "Frequencies"
193     - table "v2" command "Frequencies" subtype "Frequencies"
194 - heading "Regression" command "Regression"
195 ])
196 AT_CLEANUP
197
198 AT_SETUP([pspp-output convert])
199 AT_CHECK([pspp-output convert $srcdir/utilities/regress.spv -O format=csv - --subtypes='model*'], [0], [dnl
200 Table: Model Summary (v2)
201 R,R Square,Adjusted R Square,Std. Error of the Estimate
202 .96,.92,.91,1.49
203 ])
204 AT_CLEANUP