Show More
@@ -1,347 +1,359 b'' | |||
|
1 | 1 | This file tests the behavior of run-tests.py itself. |
|
2 | 2 | |
|
3 | 3 | Smoke test |
|
4 | 4 | ============ |
|
5 | 5 | |
|
6 | 6 | $ $TESTDIR/run-tests.py |
|
7 | 7 | |
|
8 | 8 | # Ran 0 tests, 0 skipped, 0 warned, 0 failed. |
|
9 | 9 | |
|
10 | 10 | a succesful test |
|
11 | 11 | ======================= |
|
12 | 12 | |
|
13 | 13 | $ cat > test-success.t << EOF |
|
14 | 14 | > $ echo babar |
|
15 | 15 | > babar |
|
16 | 16 | > $ echo xyzzy |
|
17 | 17 | > xyzzy |
|
18 | 18 | > EOF |
|
19 | 19 | |
|
20 | 20 | $ $TESTDIR/run-tests.py --with-hg=`which hg` |
|
21 | 21 | . |
|
22 | 22 | # Ran 1 tests, 0 skipped, 0 warned, 0 failed. |
|
23 | 23 | |
|
24 | 24 | failing test |
|
25 | 25 | ================== |
|
26 | 26 | |
|
27 | 27 | $ cat > test-failure.t << EOF |
|
28 | 28 | > $ echo babar |
|
29 | 29 | > rataxes |
|
30 | 30 | > This is a noop statement so that |
|
31 | 31 | > this test is still more bytes than success. |
|
32 | 32 | > EOF |
|
33 | 33 | |
|
34 | 34 | $ $TESTDIR/run-tests.py --with-hg=`which hg` |
|
35 | 35 | |
|
36 | 36 | --- $TESTTMP/test-failure.t |
|
37 | 37 | +++ $TESTTMP/test-failure.t.err |
|
38 | 38 | @@ -1,4 +1,4 @@ |
|
39 | 39 | $ echo babar |
|
40 | 40 | - rataxes |
|
41 | 41 | + babar |
|
42 | 42 | This is a noop statement so that |
|
43 | 43 | this test is still more bytes than success. |
|
44 | 44 | |
|
45 | 45 | ERROR: test-failure.t output changed |
|
46 | 46 | !. |
|
47 | 47 | Failed test-failure.t: output changed |
|
48 | 48 | # Ran 2 tests, 0 skipped, 0 warned, 1 failed. |
|
49 | 49 | python hash seed: * (glob) |
|
50 | 50 | [1] |
|
51 | 51 | test --xunit support |
|
52 | 52 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --xunit=xunit.xml |
|
53 | 53 | |
|
54 | 54 | --- $TESTTMP/test-failure.t |
|
55 | 55 | +++ $TESTTMP/test-failure.t.err |
|
56 | 56 | @@ -1,4 +1,4 @@ |
|
57 | 57 | $ echo babar |
|
58 | 58 | - rataxes |
|
59 | 59 | + babar |
|
60 | 60 | This is a noop statement so that |
|
61 | 61 | this test is still more bytes than success. |
|
62 | 62 | |
|
63 | 63 | ERROR: test-failure.t output changed |
|
64 | 64 | !. |
|
65 | 65 | Failed test-failure.t: output changed |
|
66 | 66 | # Ran 2 tests, 0 skipped, 0 warned, 1 failed. |
|
67 | 67 | python hash seed: * (glob) |
|
68 | 68 | [1] |
|
69 | 69 | $ cat xunit.xml |
|
70 | 70 | <?xml version="1.0" encoding="utf-8"?> |
|
71 | 71 | <testsuite errors="0" failures="1" name="run-tests" skipped="0" tests="2"> |
|
72 | 72 | <testcase name="test-success.t" time="*"/> (glob) |
|
73 | 73 | <testcase name="test-failure.t" time="*"> (glob) |
|
74 | 74 | <![CDATA[--- $TESTTMP/test-failure.t |
|
75 | 75 | +++ $TESTTMP/test-failure.t.err |
|
76 | 76 | @@ -1,4 +1,4 @@ |
|
77 | 77 | $ echo babar |
|
78 | 78 | - rataxes |
|
79 | 79 | + babar |
|
80 | 80 | This is a noop statement so that |
|
81 | 81 | this test is still more bytes than success. |
|
82 | 82 | ]]> </testcase> |
|
83 | 83 | </testsuite> |
|
84 | 84 | |
|
85 | 85 | test for --retest |
|
86 | 86 | ==================== |
|
87 | 87 | |
|
88 | 88 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest |
|
89 | 89 | |
|
90 | 90 | --- $TESTTMP/test-failure.t |
|
91 | 91 | +++ $TESTTMP/test-failure.t.err |
|
92 | 92 | @@ -1,4 +1,4 @@ |
|
93 | 93 | $ echo babar |
|
94 | 94 | - rataxes |
|
95 | 95 | + babar |
|
96 | 96 | This is a noop statement so that |
|
97 | 97 | this test is still more bytes than success. |
|
98 | 98 | |
|
99 | 99 | ERROR: test-failure.t output changed |
|
100 | 100 | ! |
|
101 | 101 | Failed test-failure.t: output changed |
|
102 | 102 | # Ran 2 tests, 1 skipped, 0 warned, 1 failed. |
|
103 | 103 | python hash seed: * (glob) |
|
104 | 104 | [1] |
|
105 | 105 | |
|
106 | 106 | Selecting Tests To Run |
|
107 | 107 | ====================== |
|
108 | 108 | |
|
109 | 109 | successful |
|
110 | 110 | |
|
111 | 111 | $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t |
|
112 | 112 | . |
|
113 | 113 | # Ran 1 tests, 0 skipped, 0 warned, 0 failed. |
|
114 | 114 | |
|
115 | 115 | success w/ keyword |
|
116 | 116 | $ $TESTDIR/run-tests.py --with-hg=`which hg` -k xyzzy |
|
117 | 117 | . |
|
118 | 118 | # Ran 2 tests, 1 skipped, 0 warned, 0 failed. |
|
119 | 119 | |
|
120 | 120 | failed |
|
121 | 121 | |
|
122 | 122 | $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t |
|
123 | 123 | |
|
124 | 124 | --- $TESTTMP/test-failure.t |
|
125 | 125 | +++ $TESTTMP/test-failure.t.err |
|
126 | 126 | @@ -1,4 +1,4 @@ |
|
127 | 127 | $ echo babar |
|
128 | 128 | - rataxes |
|
129 | 129 | + babar |
|
130 | 130 | This is a noop statement so that |
|
131 | 131 | this test is still more bytes than success. |
|
132 | 132 | |
|
133 | 133 | ERROR: test-failure.t output changed |
|
134 | 134 | ! |
|
135 | 135 | Failed test-failure.t: output changed |
|
136 | 136 | # Ran 1 tests, 0 skipped, 0 warned, 1 failed. |
|
137 | 137 | python hash seed: * (glob) |
|
138 | 138 | [1] |
|
139 | 139 | |
|
140 | 140 | failure w/ keyword |
|
141 | 141 | $ $TESTDIR/run-tests.py --with-hg=`which hg` -k rataxes |
|
142 | 142 | |
|
143 | 143 | --- $TESTTMP/test-failure.t |
|
144 | 144 | +++ $TESTTMP/test-failure.t.err |
|
145 | 145 | @@ -1,4 +1,4 @@ |
|
146 | 146 | $ echo babar |
|
147 | 147 | - rataxes |
|
148 | 148 | + babar |
|
149 | 149 | This is a noop statement so that |
|
150 | 150 | this test is still more bytes than success. |
|
151 | 151 | |
|
152 | 152 | ERROR: test-failure.t output changed |
|
153 | 153 | ! |
|
154 | 154 | Failed test-failure.t: output changed |
|
155 | 155 | # Ran 2 tests, 1 skipped, 0 warned, 1 failed. |
|
156 | 156 | python hash seed: * (glob) |
|
157 | 157 | [1] |
|
158 | 158 | |
|
159 | 159 | Running In Debug Mode |
|
160 | 160 | ====================== |
|
161 | 161 | |
|
162 | 162 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --debug |
|
163 | 163 | + echo SALT* 0 0 (glob) |
|
164 | 164 | SALT* 0 0 (glob) |
|
165 | 165 | + echo babar |
|
166 | 166 | babar |
|
167 | 167 | + echo SALT* 4 0 (glob) |
|
168 | 168 | SALT* 4 0 (glob) |
|
169 | 169 | .+ echo SALT* 0 0 (glob) |
|
170 | 170 | SALT* 0 0 (glob) |
|
171 | 171 | + echo babar |
|
172 | 172 | babar |
|
173 | 173 | + echo SALT* 2 0 (glob) |
|
174 | 174 | SALT* 2 0 (glob) |
|
175 | 175 | + echo xyzzy |
|
176 | 176 | xyzzy |
|
177 | 177 | + echo SALT* 4 0 (glob) |
|
178 | 178 | SALT* 4 0 (glob) |
|
179 | 179 | . |
|
180 | 180 | # Ran 2 tests, 0 skipped, 0 warned, 0 failed. |
|
181 | 181 | |
|
182 | 182 | Parallel runs |
|
183 | 183 | ============== |
|
184 | 184 | |
|
185 | 185 | (duplicate the failing test to get predictable output) |
|
186 | 186 | $ cp test-failure.t test-failure-copy.t |
|
187 | 187 | |
|
188 | 188 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t |
|
189 | 189 | |
|
190 | 190 | --- $TESTTMP/test-failure*.t (glob) |
|
191 | 191 | +++ $TESTTMP/test-failure*.t.err (glob) |
|
192 | 192 | @@ -1,4 +1,4 @@ |
|
193 | 193 | $ echo babar |
|
194 | 194 | - rataxes |
|
195 | 195 | + babar |
|
196 | 196 | This is a noop statement so that |
|
197 | 197 | this test is still more bytes than success. |
|
198 | 198 | |
|
199 | 199 | ERROR: test-failure*.t output changed (glob) |
|
200 | 200 | ! |
|
201 | 201 | --- $TESTTMP/test-failure*.t (glob) |
|
202 | 202 | +++ $TESTTMP/test-failure*.t.err (glob) |
|
203 | 203 | @@ -1,4 +1,4 @@ |
|
204 | 204 | $ echo babar |
|
205 | 205 | - rataxes |
|
206 | 206 | + babar |
|
207 | 207 | This is a noop statement so that |
|
208 | 208 | this test is still more bytes than success. |
|
209 | 209 | |
|
210 | 210 | ERROR: test-failure*.t output changed (glob) |
|
211 | 211 | ! |
|
212 | 212 | Failed test-failure*.t: output changed (glob) |
|
213 | 213 | Failed test-failure*.t: output changed (glob) |
|
214 | 214 | # Ran 2 tests, 0 skipped, 0 warned, 2 failed. |
|
215 | 215 | python hash seed: * (glob) |
|
216 | 216 | [1] |
|
217 | 217 | |
|
218 | 218 | (delete the duplicated test file) |
|
219 | 219 | $ rm test-failure-copy.t |
|
220 | 220 | |
|
221 | 221 | |
|
222 | 222 | Interactive run |
|
223 | 223 | =============== |
|
224 | 224 | |
|
225 | 225 | (backup the failing test) |
|
226 | 226 | $ cp test-failure.t backup |
|
227 | 227 | |
|
228 | 228 | Refuse the fix |
|
229 | 229 | |
|
230 | 230 | $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i |
|
231 | 231 | |
|
232 | 232 | --- $TESTTMP/test-failure.t |
|
233 | 233 | +++ $TESTTMP/test-failure.t.err |
|
234 | 234 | @@ -1,4 +1,4 @@ |
|
235 | 235 | $ echo babar |
|
236 | 236 | - rataxes |
|
237 | 237 | + babar |
|
238 | 238 | This is a noop statement so that |
|
239 | 239 | this test is still more bytes than success. |
|
240 | 240 | Accept this change? [n] |
|
241 | 241 | ERROR: test-failure.t output changed |
|
242 | 242 | !. |
|
243 | 243 | Failed test-failure.t: output changed |
|
244 | 244 | # Ran 2 tests, 0 skipped, 0 warned, 1 failed. |
|
245 | 245 | python hash seed: * (glob) |
|
246 | 246 | [1] |
|
247 | 247 | |
|
248 | 248 | $ cat test-failure.t |
|
249 | 249 | $ echo babar |
|
250 | 250 | rataxes |
|
251 | 251 | This is a noop statement so that |
|
252 | 252 | this test is still more bytes than success. |
|
253 | 253 | |
|
254 | View the fix | |
|
255 | ||
|
256 | $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` --view echo | |
|
257 | $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err | |
|
258 | ||
|
259 | ERROR: test-failure.t output changed | |
|
260 | !. | |
|
261 | Failed test-failure.t: output changed | |
|
262 | # Ran 2 tests, 0 skipped, 0 warned, 1 failed. | |
|
263 | python hash seed: * (glob) | |
|
264 | [1] | |
|
265 | ||
|
254 | 266 | Accept the fix |
|
255 | 267 | |
|
256 | 268 | $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i |
|
257 | 269 | |
|
258 | 270 | --- $TESTTMP/test-failure.t |
|
259 | 271 | +++ $TESTTMP/test-failure.t.err |
|
260 | 272 | @@ -1,4 +1,4 @@ |
|
261 | 273 | $ echo babar |
|
262 | 274 | - rataxes |
|
263 | 275 | + babar |
|
264 | 276 | This is a noop statement so that |
|
265 | 277 | this test is still more bytes than success. |
|
266 | 278 | Accept this change? [n] .. |
|
267 | 279 | # Ran 2 tests, 0 skipped, 0 warned, 0 failed. |
|
268 | 280 | |
|
269 | 281 | $ cat test-failure.t |
|
270 | 282 | $ echo babar |
|
271 | 283 | babar |
|
272 | 284 | This is a noop statement so that |
|
273 | 285 | this test is still more bytes than success. |
|
274 | 286 | |
|
275 | 287 | (reinstall) |
|
276 | 288 | $ mv backup test-failure.t |
|
277 | 289 | |
|
278 | 290 | No Diff |
|
279 | 291 | =============== |
|
280 | 292 | |
|
281 | 293 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff |
|
282 | 294 | !. |
|
283 | 295 | Failed test-failure.t: output changed |
|
284 | 296 | # Ran 2 tests, 0 skipped, 0 warned, 1 failed. |
|
285 | 297 | python hash seed: * (glob) |
|
286 | 298 | [1] |
|
287 | 299 | |
|
288 | 300 | test for --time |
|
289 | 301 | ================== |
|
290 | 302 | |
|
291 | 303 | $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time |
|
292 | 304 | . |
|
293 | 305 | # Ran 1 tests, 0 skipped, 0 warned, 0 failed. |
|
294 | 306 | # Producing time report |
|
295 | 307 | cuser csys real Test |
|
296 | 308 |
\s*[\d\.]{5} \s*[\d\.]{5} \ |
|
297 | 309 | |
|
298 | 310 | test for --time with --job enabled |
|
299 | 311 | ==================================== |
|
300 | 312 | |
|
301 | 313 | $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2 |
|
302 | 314 | . |
|
303 | 315 | # Ran 1 tests, 0 skipped, 0 warned, 0 failed. |
|
304 | 316 | # Producing time report |
|
305 | 317 | cuser csys real Test |
|
306 | 318 | \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) |
|
307 | 319 | |
|
308 | 320 | Skips |
|
309 | 321 | ================ |
|
310 | 322 | $ cat > test-skip.t <<EOF |
|
311 | 323 | > $ echo xyzzy |
|
312 | 324 | > #require false |
|
313 | 325 | > EOF |
|
314 | 326 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff |
|
315 | 327 | !.s |
|
316 | 328 | Skipped test-skip.t: irrelevant |
|
317 | 329 | Failed test-failure.t: output changed |
|
318 | 330 | # Ran 2 tests, 1 skipped, 0 warned, 1 failed. |
|
319 | 331 | python hash seed: * (glob) |
|
320 | 332 | [1] |
|
321 | 333 | |
|
322 | 334 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy |
|
323 | 335 | .s |
|
324 | 336 | Skipped test-skip.t: irrelevant |
|
325 | 337 | # Ran 2 tests, 2 skipped, 0 warned, 0 failed. |
|
326 | 338 | |
|
327 | 339 | Skips with xml |
|
328 | 340 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy \ |
|
329 | 341 | > --xunit=xunit.xml |
|
330 | 342 | .s |
|
331 | 343 | Skipped test-skip.t: irrelevant |
|
332 | 344 | # Ran 2 tests, 2 skipped, 0 warned, 0 failed. |
|
333 | 345 | $ cat xunit.xml |
|
334 | 346 | <?xml version="1.0" encoding="utf-8"?> |
|
335 | 347 | <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2"> |
|
336 | 348 | <testcase name="test-success.t" time="*"/> (glob) |
|
337 | 349 | </testsuite> |
|
338 | 350 | |
|
339 | 351 | Missing skips or blacklisted skips don't count as executed: |
|
340 | 352 | $ echo test-failure.t > blacklist |
|
341 | 353 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --blacklist=blacklist \ |
|
342 | 354 | > test-failure.t test-bogus.t |
|
343 | 355 | ss |
|
344 | 356 | Skipped test-bogus.t: Doesn't exist |
|
345 | 357 | Skipped test-failure.t: blacklisted |
|
346 | 358 | # Ran 0 tests, 2 skipped, 0 warned, 0 failed. |
|
347 | 359 |
General Comments 0
You need to be logged in to leave comments.
Login now