Show More
@@ -1,46 +1,52 b'' | |||
|
1 | from __future__ import print_function | |
|
1 | from __future__ import absolute_import, print_function | |
|
2 | 2 | |
|
3 | 3 | import unittest |
|
4 | 4 | |
|
5 | 5 | class TestResult(unittest._TextTestResult): |
|
6 | 6 | |
|
7 | 7 | def __init__(self, options, *args, **kwargs): |
|
8 | 8 | super(TestResult, self).__init__(*args, **kwargs) |
|
9 | 9 | self._options = options |
|
10 | 10 | |
|
11 | 11 | # unittest.TestResult didn't have skipped until 2.7. We need to |
|
12 | 12 | # polyfill it. |
|
13 | 13 | self.skipped = [] |
|
14 | 14 | |
|
15 | 15 | # We have a custom "ignored" result that isn't present in any Python |
|
16 | 16 | # unittest implementation. It is very similar to skipped. It may make |
|
17 | 17 | # sense to map it into skip some day. |
|
18 | 18 | self.ignored = [] |
|
19 | 19 | |
|
20 | 20 | self.times = [] |
|
21 | 21 | self._firststarttime = None |
|
22 | 22 | # Data stored for the benefit of generating xunit reports. |
|
23 | 23 | self.successes = [] |
|
24 | 24 | self.faildata = {} |
|
25 | 25 | |
|
26 | 26 | def addFailure(self, test, reason): |
|
27 | 27 | print("FAILURE!", test, reason) |
|
28 | 28 | |
|
29 | 29 | def addSuccess(self, test): |
|
30 | 30 | print("SUCCESS!", test) |
|
31 | 31 | |
|
32 | 32 | def addError(self, test, err): |
|
33 | 33 | print("ERR!", test, err) |
|
34 | 34 | |
|
35 | 35 | # Polyfill. |
|
36 | 36 | def addSkip(self, test, reason): |
|
37 | 37 | print("SKIP!", test, reason) |
|
38 | 38 | |
|
39 | 39 | def addIgnore(self, test, reason): |
|
40 | 40 | print("IGNORE!", test, reason) |
|
41 | 41 | |
|
42 | def onStart(self, test): | |
|
43 | print("ON_START!", test) | |
|
44 | ||
|
45 | def onEnd(self): | |
|
46 | print("ON_END!") | |
|
47 | ||
|
42 | 48 | def addOutputMismatch(self, test, ret, got, expected): |
|
43 | 49 | return False |
|
44 | 50 | |
|
45 | 51 | def stopTest(self, test, interrupted=False): |
|
46 | 52 | super(TestResult, self).stopTest(test) |
@@ -1,1821 +1,1823 b'' | |||
|
1 | 1 | This file tests the behavior of run-tests.py itself. |
|
2 | 2 | |
|
3 | 3 | Avoid interference from actual test env: |
|
4 | 4 | |
|
5 | 5 | $ . "$TESTDIR/helper-runtests.sh" |
|
6 | 6 | |
|
7 | 7 | Smoke test with install |
|
8 | 8 | ============ |
|
9 | 9 | $ $PYTHON $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE -l |
|
10 | 10 | |
|
11 | 11 | # Ran 0 tests, 0 skipped, 0 failed. |
|
12 | 12 | |
|
13 | 13 | Define a helper to avoid the install step |
|
14 | 14 | ============= |
|
15 | 15 | $ rt() |
|
16 | 16 | > { |
|
17 | 17 | > $PYTHON $TESTDIR/run-tests.py --with-hg=`which hg` "$@" |
|
18 | 18 | > } |
|
19 | 19 | |
|
20 | 20 | error paths |
|
21 | 21 | |
|
22 | 22 | #if symlink |
|
23 | 23 | $ ln -s `which true` hg |
|
24 | 24 | $ $PYTHON $TESTDIR/run-tests.py --with-hg=./hg |
|
25 | 25 | warning: --with-hg should specify an hg script |
|
26 | 26 | |
|
27 | 27 | # Ran 0 tests, 0 skipped, 0 failed. |
|
28 | 28 | $ rm hg |
|
29 | 29 | #endif |
|
30 | 30 | |
|
31 | 31 | #if execbit |
|
32 | 32 | $ touch hg |
|
33 | 33 | $ $PYTHON $TESTDIR/run-tests.py --with-hg=./hg |
|
34 | 34 | usage: run-tests.py [options] [tests] |
|
35 | 35 | run-tests.py: error: --with-hg must specify an executable hg script |
|
36 | 36 | [2] |
|
37 | 37 | $ rm hg |
|
38 | 38 | #endif |
|
39 | 39 | |
|
40 | 40 | Features for testing optional lines |
|
41 | 41 | =================================== |
|
42 | 42 | |
|
43 | 43 | $ cat > hghaveaddon.py <<EOF |
|
44 | 44 | > import hghave |
|
45 | 45 | > @hghave.check("custom", "custom hghave feature") |
|
46 | 46 | > def has_custom(): |
|
47 | 47 | > return True |
|
48 | 48 | > @hghave.check("missing", "missing hghave feature") |
|
49 | 49 | > def has_missing(): |
|
50 | 50 | > return False |
|
51 | 51 | > EOF |
|
52 | 52 | |
|
53 | 53 | an empty test |
|
54 | 54 | ======================= |
|
55 | 55 | |
|
56 | 56 | $ touch test-empty.t |
|
57 | 57 | $ rt |
|
58 | 58 | . |
|
59 | 59 | # Ran 1 tests, 0 skipped, 0 failed. |
|
60 | 60 | $ rm test-empty.t |
|
61 | 61 | |
|
62 | 62 | a succesful test |
|
63 | 63 | ======================= |
|
64 | 64 | |
|
65 | 65 | $ cat > test-success.t << EOF |
|
66 | 66 | > $ echo babar |
|
67 | 67 | > babar |
|
68 | 68 | > $ echo xyzzy |
|
69 | 69 | > dont_print (?) |
|
70 | 70 | > nothing[42]line (re) (?) |
|
71 | 71 | > never*happens (glob) (?) |
|
72 | 72 | > more_nothing (?) |
|
73 | 73 | > xyzzy |
|
74 | 74 | > nor this (?) |
|
75 | 75 | > $ printf 'abc\ndef\nxyz\n' |
|
76 | 76 | > 123 (?) |
|
77 | 77 | > abc |
|
78 | 78 | > def (?) |
|
79 | 79 | > 456 (?) |
|
80 | 80 | > xyz |
|
81 | 81 | > $ printf 'zyx\nwvu\ntsr\n' |
|
82 | 82 | > abc (?) |
|
83 | 83 | > zyx (custom !) |
|
84 | 84 | > wvu |
|
85 | 85 | > no_print (no-custom !) |
|
86 | 86 | > tsr (no-missing !) |
|
87 | 87 | > missing (missing !) |
|
88 | 88 | > EOF |
|
89 | 89 | |
|
90 | 90 | $ rt |
|
91 | 91 | . |
|
92 | 92 | # Ran 1 tests, 0 skipped, 0 failed. |
|
93 | 93 | |
|
94 | 94 | failing test |
|
95 | 95 | ================== |
|
96 | 96 | |
|
97 | 97 | test churn with globs |
|
98 | 98 | $ cat > test-failure.t <<EOF |
|
99 | 99 | > $ echo "bar-baz"; echo "bar-bad"; echo foo |
|
100 | 100 | > bar*bad (glob) |
|
101 | 101 | > bar*baz (glob) |
|
102 | 102 | > | fo (re) |
|
103 | 103 | > EOF |
|
104 | 104 | $ rt test-failure.t |
|
105 | 105 | |
|
106 | 106 | --- $TESTTMP/test-failure.t |
|
107 | 107 | +++ $TESTTMP/test-failure.t.err |
|
108 | 108 | @@ -1,4 +1,4 @@ |
|
109 | 109 | $ echo "bar-baz"; echo "bar-bad"; echo foo |
|
110 | 110 | + bar*baz (glob) |
|
111 | 111 | bar*bad (glob) |
|
112 | 112 | - bar*baz (glob) |
|
113 | 113 | - | fo (re) |
|
114 | 114 | + foo |
|
115 | 115 | |
|
116 | 116 | ERROR: test-failure.t output changed |
|
117 | 117 | ! |
|
118 | 118 | Failed test-failure.t: output changed |
|
119 | 119 | # Ran 1 tests, 0 skipped, 1 failed. |
|
120 | 120 | python hash seed: * (glob) |
|
121 | 121 | [1] |
|
122 | 122 | |
|
123 | 123 | test how multiple globs gets matched with lines in output |
|
124 | 124 | $ cat > test-failure-globs.t <<EOF |
|
125 | 125 | > $ echo "context"; echo "context"; \ |
|
126 | 126 | > echo "key: 1"; echo "value: not a"; \ |
|
127 | 127 | > echo "key: 2"; echo "value: not b"; \ |
|
128 | 128 | > echo "key: 3"; echo "value: c"; \ |
|
129 | 129 | > echo "key: 4"; echo "value: d" |
|
130 | 130 | > context |
|
131 | 131 | > context |
|
132 | 132 | > key: 1 |
|
133 | 133 | > value: a |
|
134 | 134 | > key: 2 |
|
135 | 135 | > value: b |
|
136 | 136 | > key: 3 |
|
137 | 137 | > value: * (glob) |
|
138 | 138 | > key: 4 |
|
139 | 139 | > value: * (glob) |
|
140 | 140 | > EOF |
|
141 | 141 | $ rt test-failure-globs.t |
|
142 | 142 | |
|
143 | 143 | --- $TESTTMP/test-failure-globs.t |
|
144 | 144 | +++ $TESTTMP/test-failure-globs.t.err |
|
145 | 145 | @@ -2,9 +2,9 @@ |
|
146 | 146 | context |
|
147 | 147 | context |
|
148 | 148 | key: 1 |
|
149 | 149 | - value: a |
|
150 | 150 | + value: not a |
|
151 | 151 | key: 2 |
|
152 | 152 | - value: b |
|
153 | 153 | + value: not b |
|
154 | 154 | key: 3 |
|
155 | 155 | value: * (glob) |
|
156 | 156 | key: 4 |
|
157 | 157 | |
|
158 | 158 | ERROR: test-failure-globs.t output changed |
|
159 | 159 | ! |
|
160 | 160 | Failed test-failure-globs.t: output changed |
|
161 | 161 | # Ran 1 tests, 0 skipped, 1 failed. |
|
162 | 162 | python hash seed: * (glob) |
|
163 | 163 | [1] |
|
164 | 164 | $ rm test-failure-globs.t |
|
165 | 165 | |
|
166 | 166 | test diff colorisation |
|
167 | 167 | |
|
168 | 168 | #if no-windows pygments |
|
169 | 169 | $ rt test-failure.t --color always |
|
170 | 170 | |
|
171 | 171 | \x1b[38;5;124m--- $TESTTMP/test-failure.t\x1b[39m (esc) |
|
172 | 172 | \x1b[38;5;34m+++ $TESTTMP/test-failure.t.err\x1b[39m (esc) |
|
173 | 173 | \x1b[38;5;90;01m@@ -1,4 +1,4 @@\x1b[39;00m (esc) |
|
174 | 174 | $ echo "bar-baz"; echo "bar-bad"; echo foo |
|
175 | 175 | \x1b[38;5;34m+ bar*baz (glob)\x1b[39m (esc) |
|
176 | 176 | bar*bad (glob) |
|
177 | 177 | \x1b[38;5;124m- bar*baz (glob)\x1b[39m (esc) |
|
178 | 178 | \x1b[38;5;124m- | fo (re)\x1b[39m (esc) |
|
179 | 179 | \x1b[38;5;34m+ foo\x1b[39m (esc) |
|
180 | 180 | |
|
181 | 181 | \x1b[38;5;88mERROR: \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m output changed\x1b[39m (esc) |
|
182 | 182 | ! |
|
183 | 183 | \x1b[38;5;88mFailed \x1b[39m\x1b[38;5;9mtest-failure.t\x1b[39m\x1b[38;5;88m: output changed\x1b[39m (esc) |
|
184 | 184 | # Ran 1 tests, 0 skipped, 1 failed. |
|
185 | 185 | python hash seed: * (glob) |
|
186 | 186 | [1] |
|
187 | 187 | |
|
188 | 188 | $ rt test-failure.t 2> tmp.log |
|
189 | 189 | [1] |
|
190 | 190 | $ cat tmp.log |
|
191 | 191 | |
|
192 | 192 | --- $TESTTMP/test-failure.t |
|
193 | 193 | +++ $TESTTMP/test-failure.t.err |
|
194 | 194 | @@ -1,4 +1,4 @@ |
|
195 | 195 | $ echo "bar-baz"; echo "bar-bad"; echo foo |
|
196 | 196 | + bar*baz (glob) |
|
197 | 197 | bar*bad (glob) |
|
198 | 198 | - bar*baz (glob) |
|
199 | 199 | - | fo (re) |
|
200 | 200 | + foo |
|
201 | 201 | |
|
202 | 202 | ERROR: test-failure.t output changed |
|
203 | 203 | ! |
|
204 | 204 | Failed test-failure.t: output changed |
|
205 | 205 | # Ran 1 tests, 0 skipped, 1 failed. |
|
206 | 206 | python hash seed: * (glob) |
|
207 | 207 | #endif |
|
208 | 208 | |
|
209 | 209 | $ cat > test-failure.t << EOF |
|
210 | 210 | > $ true |
|
211 | 211 | > should go away (true !) |
|
212 | 212 | > $ true |
|
213 | 213 | > should stay (false !) |
|
214 | 214 | > |
|
215 | 215 | > Should remove first line, not second or third |
|
216 | 216 | > $ echo 'testing' |
|
217 | 217 | > baz*foo (glob) (true !) |
|
218 | 218 | > foobar*foo (glob) (false !) |
|
219 | 219 | > te*ting (glob) (true !) |
|
220 | 220 | > |
|
221 | 221 | > Should keep first two lines, remove third and last |
|
222 | 222 | > $ echo 'testing' |
|
223 | 223 | > test.ng (re) (true !) |
|
224 | 224 | > foo.ar (re) (false !) |
|
225 | 225 | > b.r (re) (true !) |
|
226 | 226 | > missing (?) |
|
227 | 227 | > awol (true !) |
|
228 | 228 | > |
|
229 | 229 | > The "missing" line should stay, even though awol is dropped |
|
230 | 230 | > $ echo 'testing' |
|
231 | 231 | > test.ng (re) (true !) |
|
232 | 232 | > foo.ar (?) |
|
233 | 233 | > awol |
|
234 | 234 | > missing (?) |
|
235 | 235 | > EOF |
|
236 | 236 | $ rt test-failure.t |
|
237 | 237 | |
|
238 | 238 | --- $TESTTMP/test-failure.t |
|
239 | 239 | +++ $TESTTMP/test-failure.t.err |
|
240 | 240 | @@ -1,11 +1,9 @@ |
|
241 | 241 | $ true |
|
242 | 242 | - should go away (true !) |
|
243 | 243 | $ true |
|
244 | 244 | should stay (false !) |
|
245 | 245 | |
|
246 | 246 | Should remove first line, not second or third |
|
247 | 247 | $ echo 'testing' |
|
248 | 248 | - baz*foo (glob) (true !) |
|
249 | 249 | foobar*foo (glob) (false !) |
|
250 | 250 | te*ting (glob) (true !) |
|
251 | 251 | |
|
252 | 252 | foo.ar (re) (false !) |
|
253 | 253 | missing (?) |
|
254 | 254 | @@ -13,13 +11,10 @@ |
|
255 | 255 | $ echo 'testing' |
|
256 | 256 | test.ng (re) (true !) |
|
257 | 257 | foo.ar (re) (false !) |
|
258 | 258 | - b.r (re) (true !) |
|
259 | 259 | missing (?) |
|
260 | 260 | - awol (true !) |
|
261 | 261 | |
|
262 | 262 | The "missing" line should stay, even though awol is dropped |
|
263 | 263 | $ echo 'testing' |
|
264 | 264 | test.ng (re) (true !) |
|
265 | 265 | foo.ar (?) |
|
266 | 266 | - awol |
|
267 | 267 | missing (?) |
|
268 | 268 | |
|
269 | 269 | ERROR: test-failure.t output changed |
|
270 | 270 | ! |
|
271 | 271 | Failed test-failure.t: output changed |
|
272 | 272 | # Ran 1 tests, 0 skipped, 1 failed. |
|
273 | 273 | python hash seed: * (glob) |
|
274 | 274 | [1] |
|
275 | 275 | |
|
276 | 276 | basic failing test |
|
277 | 277 | $ cat > test-failure.t << EOF |
|
278 | 278 | > $ echo babar |
|
279 | 279 | > rataxes |
|
280 | 280 | > This is a noop statement so that |
|
281 | 281 | > this test is still more bytes than success. |
|
282 | 282 | > pad pad pad pad............................................................ |
|
283 | 283 | > pad pad pad pad............................................................ |
|
284 | 284 | > pad pad pad pad............................................................ |
|
285 | 285 | > pad pad pad pad............................................................ |
|
286 | 286 | > pad pad pad pad............................................................ |
|
287 | 287 | > pad pad pad pad............................................................ |
|
288 | 288 | > EOF |
|
289 | 289 | |
|
290 | 290 | >>> fh = open('test-failure-unicode.t', 'wb') |
|
291 | 291 | >>> fh.write(u' $ echo babar\u03b1\n'.encode('utf-8')) and None |
|
292 | 292 | >>> fh.write(u' l\u03b5\u03b5t\n'.encode('utf-8')) and None |
|
293 | 293 | |
|
294 | 294 | $ rt |
|
295 | 295 | |
|
296 | 296 | --- $TESTTMP/test-failure.t |
|
297 | 297 | +++ $TESTTMP/test-failure.t.err |
|
298 | 298 | @@ -1,5 +1,5 @@ |
|
299 | 299 | $ echo babar |
|
300 | 300 | - rataxes |
|
301 | 301 | + babar |
|
302 | 302 | This is a noop statement so that |
|
303 | 303 | this test is still more bytes than success. |
|
304 | 304 | pad pad pad pad............................................................ |
|
305 | 305 | |
|
306 | 306 | ERROR: test-failure.t output changed |
|
307 | 307 | !. |
|
308 | 308 | --- $TESTTMP/test-failure-unicode.t |
|
309 | 309 | +++ $TESTTMP/test-failure-unicode.t.err |
|
310 | 310 | @@ -1,2 +1,2 @@ |
|
311 | 311 | $ echo babar\xce\xb1 (esc) |
|
312 | 312 | - l\xce\xb5\xce\xb5t (esc) |
|
313 | 313 | + babar\xce\xb1 (esc) |
|
314 | 314 | |
|
315 | 315 | ERROR: test-failure-unicode.t output changed |
|
316 | 316 | ! |
|
317 | 317 | Failed test-failure.t: output changed |
|
318 | 318 | Failed test-failure-unicode.t: output changed |
|
319 | 319 | # Ran 3 tests, 0 skipped, 2 failed. |
|
320 | 320 | python hash seed: * (glob) |
|
321 | 321 | [1] |
|
322 | 322 | |
|
323 | 323 | test --outputdir |
|
324 | 324 | $ mkdir output |
|
325 | 325 | $ rt --outputdir output |
|
326 | 326 | |
|
327 | 327 | --- $TESTTMP/test-failure.t |
|
328 | 328 | +++ $TESTTMP/output/test-failure.t.err |
|
329 | 329 | @@ -1,5 +1,5 @@ |
|
330 | 330 | $ echo babar |
|
331 | 331 | - rataxes |
|
332 | 332 | + babar |
|
333 | 333 | This is a noop statement so that |
|
334 | 334 | this test is still more bytes than success. |
|
335 | 335 | pad pad pad pad............................................................ |
|
336 | 336 | |
|
337 | 337 | ERROR: test-failure.t output changed |
|
338 | 338 | !. |
|
339 | 339 | --- $TESTTMP/test-failure-unicode.t |
|
340 | 340 | +++ $TESTTMP/output/test-failure-unicode.t.err |
|
341 | 341 | @@ -1,2 +1,2 @@ |
|
342 | 342 | $ echo babar\xce\xb1 (esc) |
|
343 | 343 | - l\xce\xb5\xce\xb5t (esc) |
|
344 | 344 | + babar\xce\xb1 (esc) |
|
345 | 345 | |
|
346 | 346 | ERROR: test-failure-unicode.t output changed |
|
347 | 347 | ! |
|
348 | 348 | Failed test-failure.t: output changed |
|
349 | 349 | Failed test-failure-unicode.t: output changed |
|
350 | 350 | # Ran 3 tests, 0 skipped, 2 failed. |
|
351 | 351 | python hash seed: * (glob) |
|
352 | 352 | [1] |
|
353 | 353 | $ ls -a output |
|
354 | 354 | . |
|
355 | 355 | .. |
|
356 | 356 | .testtimes |
|
357 | 357 | test-failure-unicode.t.err |
|
358 | 358 | test-failure.t.err |
|
359 | 359 | |
|
360 | 360 | test --xunit support |
|
361 | 361 | $ rt --xunit=xunit.xml |
|
362 | 362 | |
|
363 | 363 | --- $TESTTMP/test-failure.t |
|
364 | 364 | +++ $TESTTMP/test-failure.t.err |
|
365 | 365 | @@ -1,5 +1,5 @@ |
|
366 | 366 | $ echo babar |
|
367 | 367 | - rataxes |
|
368 | 368 | + babar |
|
369 | 369 | This is a noop statement so that |
|
370 | 370 | this test is still more bytes than success. |
|
371 | 371 | pad pad pad pad............................................................ |
|
372 | 372 | |
|
373 | 373 | ERROR: test-failure.t output changed |
|
374 | 374 | !. |
|
375 | 375 | --- $TESTTMP/test-failure-unicode.t |
|
376 | 376 | +++ $TESTTMP/test-failure-unicode.t.err |
|
377 | 377 | @@ -1,2 +1,2 @@ |
|
378 | 378 | $ echo babar\xce\xb1 (esc) |
|
379 | 379 | - l\xce\xb5\xce\xb5t (esc) |
|
380 | 380 | + babar\xce\xb1 (esc) |
|
381 | 381 | |
|
382 | 382 | ERROR: test-failure-unicode.t output changed |
|
383 | 383 | ! |
|
384 | 384 | Failed test-failure.t: output changed |
|
385 | 385 | Failed test-failure-unicode.t: output changed |
|
386 | 386 | # Ran 3 tests, 0 skipped, 2 failed. |
|
387 | 387 | python hash seed: * (glob) |
|
388 | 388 | [1] |
|
389 | 389 | $ cat xunit.xml |
|
390 | 390 | <?xml version="1.0" encoding="utf-8"?> |
|
391 | 391 | <testsuite errors="0" failures="2" name="run-tests" skipped="0" tests="3"> |
|
392 | 392 | <testcase name="test-success.t" time="*"/> (glob) |
|
393 | 393 | <testcase name="test-failure-unicode.t" time="*"> (glob) |
|
394 | 394 | <failure message="output changed" type="output-mismatch"> |
|
395 | 395 | <![CDATA[--- $TESTTMP/test-failure-unicode.t |
|
396 | 396 | +++ $TESTTMP/test-failure-unicode.t.err |
|
397 | 397 | @@ -1,2 +1,2 @@ |
|
398 | 398 | $ echo babar\xce\xb1 (esc) |
|
399 | 399 | - l\xce\xb5\xce\xb5t (esc) |
|
400 | 400 | + babar\xce\xb1 (esc) |
|
401 | 401 | ]]> </failure> |
|
402 | 402 | </testcase> |
|
403 | 403 | <testcase name="test-failure.t" time="*"> (glob) |
|
404 | 404 | <failure message="output changed" type="output-mismatch"> |
|
405 | 405 | <![CDATA[--- $TESTTMP/test-failure.t |
|
406 | 406 | +++ $TESTTMP/test-failure.t.err |
|
407 | 407 | @@ -1,5 +1,5 @@ |
|
408 | 408 | $ echo babar |
|
409 | 409 | - rataxes |
|
410 | 410 | + babar |
|
411 | 411 | This is a noop statement so that |
|
412 | 412 | this test is still more bytes than success. |
|
413 | 413 | pad pad pad pad............................................................ |
|
414 | 414 | ]]> </failure> |
|
415 | 415 | </testcase> |
|
416 | 416 | </testsuite> |
|
417 | 417 | |
|
418 | 418 | $ cat .testtimes |
|
419 | 419 | test-empty.t * (glob) |
|
420 | 420 | test-failure-globs.t * (glob) |
|
421 | 421 | test-failure-unicode.t * (glob) |
|
422 | 422 | test-failure.t * (glob) |
|
423 | 423 | test-success.t * (glob) |
|
424 | 424 | |
|
425 | 425 | $ rt --list-tests |
|
426 | 426 | test-failure-unicode.t |
|
427 | 427 | test-failure.t |
|
428 | 428 | test-success.t |
|
429 | 429 | |
|
430 | 430 | $ rt --list-tests --json |
|
431 | 431 | test-failure-unicode.t |
|
432 | 432 | test-failure.t |
|
433 | 433 | test-success.t |
|
434 | 434 | $ cat report.json |
|
435 | 435 | testreport ={ |
|
436 | 436 | "test-failure-unicode.t": { |
|
437 | 437 | "result": "success" |
|
438 | 438 | }, |
|
439 | 439 | "test-failure.t": { |
|
440 | 440 | "result": "success" |
|
441 | 441 | }, |
|
442 | 442 | "test-success.t": { |
|
443 | 443 | "result": "success" |
|
444 | 444 | } |
|
445 | 445 | } (no-eol) |
|
446 | 446 | |
|
447 | 447 | $ rt --list-tests --xunit=xunit.xml |
|
448 | 448 | test-failure-unicode.t |
|
449 | 449 | test-failure.t |
|
450 | 450 | test-success.t |
|
451 | 451 | $ cat xunit.xml |
|
452 | 452 | <?xml version="1.0" encoding="utf-8"?> |
|
453 | 453 | <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0"> |
|
454 | 454 | <testcase name="test-failure-unicode.t"/> |
|
455 | 455 | <testcase name="test-failure.t"/> |
|
456 | 456 | <testcase name="test-success.t"/> |
|
457 | 457 | </testsuite> |
|
458 | 458 | |
|
459 | 459 | $ rt --list-tests test-failure* --json --xunit=xunit.xml --outputdir output |
|
460 | 460 | test-failure-unicode.t |
|
461 | 461 | test-failure.t |
|
462 | 462 | $ cat output/report.json |
|
463 | 463 | testreport ={ |
|
464 | 464 | "test-failure-unicode.t": { |
|
465 | 465 | "result": "success" |
|
466 | 466 | }, |
|
467 | 467 | "test-failure.t": { |
|
468 | 468 | "result": "success" |
|
469 | 469 | } |
|
470 | 470 | } (no-eol) |
|
471 | 471 | $ cat xunit.xml |
|
472 | 472 | <?xml version="1.0" encoding="utf-8"?> |
|
473 | 473 | <testsuite errors="0" failures="0" name="run-tests" skipped="0" tests="0"> |
|
474 | 474 | <testcase name="test-failure-unicode.t"/> |
|
475 | 475 | <testcase name="test-failure.t"/> |
|
476 | 476 | </testsuite> |
|
477 | 477 | |
|
478 | 478 | $ rm test-failure-unicode.t |
|
479 | 479 | |
|
480 | 480 | test for --retest |
|
481 | 481 | ==================== |
|
482 | 482 | |
|
483 | 483 | $ rt --retest |
|
484 | 484 | |
|
485 | 485 | --- $TESTTMP/test-failure.t |
|
486 | 486 | +++ $TESTTMP/test-failure.t.err |
|
487 | 487 | @@ -1,5 +1,5 @@ |
|
488 | 488 | $ echo babar |
|
489 | 489 | - rataxes |
|
490 | 490 | + babar |
|
491 | 491 | This is a noop statement so that |
|
492 | 492 | this test is still more bytes than success. |
|
493 | 493 | pad pad pad pad............................................................ |
|
494 | 494 | |
|
495 | 495 | ERROR: test-failure.t output changed |
|
496 | 496 | ! |
|
497 | 497 | Failed test-failure.t: output changed |
|
498 | 498 | # Ran 2 tests, 1 skipped, 1 failed. |
|
499 | 499 | python hash seed: * (glob) |
|
500 | 500 | [1] |
|
501 | 501 | |
|
502 | 502 | --retest works with --outputdir |
|
503 | 503 | $ rm -r output |
|
504 | 504 | $ mkdir output |
|
505 | 505 | $ mv test-failure.t.err output |
|
506 | 506 | $ rt --retest --outputdir output |
|
507 | 507 | |
|
508 | 508 | --- $TESTTMP/test-failure.t |
|
509 | 509 | +++ $TESTTMP/output/test-failure.t.err |
|
510 | 510 | @@ -1,5 +1,5 @@ |
|
511 | 511 | $ echo babar |
|
512 | 512 | - rataxes |
|
513 | 513 | + babar |
|
514 | 514 | This is a noop statement so that |
|
515 | 515 | this test is still more bytes than success. |
|
516 | 516 | pad pad pad pad............................................................ |
|
517 | 517 | |
|
518 | 518 | ERROR: test-failure.t output changed |
|
519 | 519 | ! |
|
520 | 520 | Failed test-failure.t: output changed |
|
521 | 521 | # Ran 2 tests, 1 skipped, 1 failed. |
|
522 | 522 | python hash seed: * (glob) |
|
523 | 523 | [1] |
|
524 | 524 | |
|
525 | 525 | Selecting Tests To Run |
|
526 | 526 | ====================== |
|
527 | 527 | |
|
528 | 528 | successful |
|
529 | 529 | |
|
530 | 530 | $ rt test-success.t |
|
531 | 531 | . |
|
532 | 532 | # Ran 1 tests, 0 skipped, 0 failed. |
|
533 | 533 | |
|
534 | 534 | success w/ keyword |
|
535 | 535 | $ rt -k xyzzy |
|
536 | 536 | . |
|
537 | 537 | # Ran 2 tests, 1 skipped, 0 failed. |
|
538 | 538 | |
|
539 | 539 | failed |
|
540 | 540 | |
|
541 | 541 | $ rt test-failure.t |
|
542 | 542 | |
|
543 | 543 | --- $TESTTMP/test-failure.t |
|
544 | 544 | +++ $TESTTMP/test-failure.t.err |
|
545 | 545 | @@ -1,5 +1,5 @@ |
|
546 | 546 | $ echo babar |
|
547 | 547 | - rataxes |
|
548 | 548 | + babar |
|
549 | 549 | This is a noop statement so that |
|
550 | 550 | this test is still more bytes than success. |
|
551 | 551 | pad pad pad pad............................................................ |
|
552 | 552 | |
|
553 | 553 | ERROR: test-failure.t output changed |
|
554 | 554 | ! |
|
555 | 555 | Failed test-failure.t: output changed |
|
556 | 556 | # Ran 1 tests, 0 skipped, 1 failed. |
|
557 | 557 | python hash seed: * (glob) |
|
558 | 558 | [1] |
|
559 | 559 | |
|
560 | 560 | failure w/ keyword |
|
561 | 561 | $ rt -k rataxes |
|
562 | 562 | |
|
563 | 563 | --- $TESTTMP/test-failure.t |
|
564 | 564 | +++ $TESTTMP/test-failure.t.err |
|
565 | 565 | @@ -1,5 +1,5 @@ |
|
566 | 566 | $ echo babar |
|
567 | 567 | - rataxes |
|
568 | 568 | + babar |
|
569 | 569 | This is a noop statement so that |
|
570 | 570 | this test is still more bytes than success. |
|
571 | 571 | pad pad pad pad............................................................ |
|
572 | 572 | |
|
573 | 573 | ERROR: test-failure.t output changed |
|
574 | 574 | ! |
|
575 | 575 | Failed test-failure.t: output changed |
|
576 | 576 | # Ran 2 tests, 1 skipped, 1 failed. |
|
577 | 577 | python hash seed: * (glob) |
|
578 | 578 | [1] |
|
579 | 579 | |
|
580 | 580 | Verify that when a process fails to start we show a useful message |
|
581 | 581 | ================================================================== |
|
582 | 582 | |
|
583 | 583 | $ cat > test-serve-fail.t <<EOF |
|
584 | 584 | > $ echo 'abort: child process failed to start blah' |
|
585 | 585 | > EOF |
|
586 | 586 | $ rt test-serve-fail.t |
|
587 | 587 | |
|
588 | 588 | --- $TESTTMP/test-serve-fail.t |
|
589 | 589 | +++ $TESTTMP/test-serve-fail.t.err |
|
590 | 590 | @@ -1* +1,2 @@ (glob) |
|
591 | 591 | $ echo 'abort: child process failed to start blah' |
|
592 | 592 | + abort: child process failed to start blah |
|
593 | 593 | |
|
594 | 594 | ERROR: test-serve-fail.t output changed |
|
595 | 595 | ! |
|
596 | 596 | Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob) |
|
597 | 597 | # Ran 1 tests, 0 skipped, 1 failed. |
|
598 | 598 | python hash seed: * (glob) |
|
599 | 599 | [1] |
|
600 | 600 | $ rm test-serve-fail.t |
|
601 | 601 | |
|
602 | 602 | Verify that we can try other ports |
|
603 | 603 | =================================== |
|
604 | 604 | |
|
605 | 605 | Extensions aren't inherited by the invoked run-tests.py. An extension |
|
606 | 606 | introducing a repository requirement could cause this to fail. So we force |
|
607 | 607 | HGRCPATH to get a clean environment. |
|
608 | 608 | |
|
609 | 609 | $ HGRCPATH= hg init inuse |
|
610 | 610 | $ hg serve -R inuse -p $HGPORT -d --pid-file=blocks.pid |
|
611 | 611 | $ cat blocks.pid >> $DAEMON_PIDS |
|
612 | 612 | $ cat > test-serve-inuse.t <<EOF |
|
613 | 613 | > $ hg serve -R `pwd`/inuse -p \$HGPORT -d --pid-file=hg.pid |
|
614 | 614 | > $ cat hg.pid >> \$DAEMON_PIDS |
|
615 | 615 | > EOF |
|
616 | 616 | $ rt test-serve-inuse.t |
|
617 | 617 | . |
|
618 | 618 | # Ran 1 tests, 0 skipped, 0 failed. |
|
619 | 619 | $ rm test-serve-inuse.t |
|
620 | 620 | $ killdaemons.py $DAEMON_PIDS |
|
621 | 621 | |
|
622 | 622 | Running In Debug Mode |
|
623 | 623 | ====================== |
|
624 | 624 | |
|
625 | 625 | $ rt --debug 2>&1 | grep -v pwd |
|
626 | 626 | + echo *SALT* 0 0 (glob) |
|
627 | 627 | *SALT* 0 0 (glob) |
|
628 | 628 | + echo babar |
|
629 | 629 | babar |
|
630 | 630 | + echo *SALT* 10 0 (glob) |
|
631 | 631 | *SALT* 10 0 (glob) |
|
632 | 632 | *+ echo *SALT* 0 0 (glob) |
|
633 | 633 | *SALT* 0 0 (glob) |
|
634 | 634 | + echo babar |
|
635 | 635 | babar |
|
636 | 636 | + echo *SALT* 2 0 (glob) |
|
637 | 637 | *SALT* 2 0 (glob) |
|
638 | 638 | + echo xyzzy |
|
639 | 639 | xyzzy |
|
640 | 640 | + echo *SALT* 9 0 (glob) |
|
641 | 641 | *SALT* 9 0 (glob) |
|
642 | 642 | + printf *abc\ndef\nxyz\n* (glob) |
|
643 | 643 | abc |
|
644 | 644 | def |
|
645 | 645 | xyz |
|
646 | 646 | + echo *SALT* 15 0 (glob) |
|
647 | 647 | *SALT* 15 0 (glob) |
|
648 | 648 | + printf *zyx\nwvu\ntsr\n* (glob) |
|
649 | 649 | zyx |
|
650 | 650 | wvu |
|
651 | 651 | tsr |
|
652 | 652 | + echo *SALT* 22 0 (glob) |
|
653 | 653 | *SALT* 22 0 (glob) |
|
654 | 654 | . |
|
655 | 655 | # Ran 2 tests, 0 skipped, 0 failed. |
|
656 | 656 | |
|
657 | 657 | Parallel runs |
|
658 | 658 | ============== |
|
659 | 659 | |
|
660 | 660 | (duplicate the failing test to get predictable output) |
|
661 | 661 | $ cp test-failure.t test-failure-copy.t |
|
662 | 662 | |
|
663 | 663 | $ rt --jobs 2 test-failure*.t -n |
|
664 | 664 | !! |
|
665 | 665 | Failed test-failure*.t: output changed (glob) |
|
666 | 666 | Failed test-failure*.t: output changed (glob) |
|
667 | 667 | # Ran 2 tests, 0 skipped, 2 failed. |
|
668 | 668 | python hash seed: * (glob) |
|
669 | 669 | [1] |
|
670 | 670 | |
|
671 | 671 | failures in parallel with --first should only print one failure |
|
672 | 672 | $ rt --jobs 2 --first test-failure*.t |
|
673 | 673 | |
|
674 | 674 | --- $TESTTMP/test-failure*.t (glob) |
|
675 | 675 | +++ $TESTTMP/test-failure*.t.err (glob) |
|
676 | 676 | @@ -1,5 +1,5 @@ |
|
677 | 677 | $ echo babar |
|
678 | 678 | - rataxes |
|
679 | 679 | + babar |
|
680 | 680 | This is a noop statement so that |
|
681 | 681 | this test is still more bytes than success. |
|
682 | 682 | pad pad pad pad............................................................ |
|
683 | 683 | |
|
684 | 684 | Failed test-failure*.t: output changed (glob) |
|
685 | 685 | Failed test-failure*.t: output changed (glob) |
|
686 | 686 | # Ran 2 tests, 0 skipped, 2 failed. |
|
687 | 687 | python hash seed: * (glob) |
|
688 | 688 | [1] |
|
689 | 689 | |
|
690 | 690 | |
|
691 | 691 | (delete the duplicated test file) |
|
692 | 692 | $ rm test-failure-copy.t |
|
693 | 693 | |
|
694 | 694 | |
|
695 | 695 | Interactive run |
|
696 | 696 | =============== |
|
697 | 697 | |
|
698 | 698 | (backup the failing test) |
|
699 | 699 | $ cp test-failure.t backup |
|
700 | 700 | |
|
701 | 701 | Refuse the fix |
|
702 | 702 | |
|
703 | 703 | $ echo 'n' | rt -i |
|
704 | 704 | |
|
705 | 705 | --- $TESTTMP/test-failure.t |
|
706 | 706 | +++ $TESTTMP/test-failure.t.err |
|
707 | 707 | @@ -1,5 +1,5 @@ |
|
708 | 708 | $ echo babar |
|
709 | 709 | - rataxes |
|
710 | 710 | + babar |
|
711 | 711 | This is a noop statement so that |
|
712 | 712 | this test is still more bytes than success. |
|
713 | 713 | pad pad pad pad............................................................ |
|
714 | 714 | Accept this change? [n] |
|
715 | 715 | ERROR: test-failure.t output changed |
|
716 | 716 | !. |
|
717 | 717 | Failed test-failure.t: output changed |
|
718 | 718 | # Ran 2 tests, 0 skipped, 1 failed. |
|
719 | 719 | python hash seed: * (glob) |
|
720 | 720 | [1] |
|
721 | 721 | |
|
722 | 722 | $ cat test-failure.t |
|
723 | 723 | $ echo babar |
|
724 | 724 | rataxes |
|
725 | 725 | This is a noop statement so that |
|
726 | 726 | this test is still more bytes than success. |
|
727 | 727 | pad pad pad pad............................................................ |
|
728 | 728 | pad pad pad pad............................................................ |
|
729 | 729 | pad pad pad pad............................................................ |
|
730 | 730 | pad pad pad pad............................................................ |
|
731 | 731 | pad pad pad pad............................................................ |
|
732 | 732 | pad pad pad pad............................................................ |
|
733 | 733 | |
|
734 | 734 | Interactive with custom view |
|
735 | 735 | |
|
736 | 736 | $ echo 'n' | rt -i --view echo |
|
737 | 737 | $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err |
|
738 | 738 | Accept this change? [n]* (glob) |
|
739 | 739 | ERROR: test-failure.t output changed |
|
740 | 740 | !. |
|
741 | 741 | Failed test-failure.t: output changed |
|
742 | 742 | # Ran 2 tests, 0 skipped, 1 failed. |
|
743 | 743 | python hash seed: * (glob) |
|
744 | 744 | [1] |
|
745 | 745 | |
|
746 | 746 | View the fix |
|
747 | 747 | |
|
748 | 748 | $ echo 'y' | rt --view echo |
|
749 | 749 | $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err |
|
750 | 750 | |
|
751 | 751 | ERROR: test-failure.t output changed |
|
752 | 752 | !. |
|
753 | 753 | Failed test-failure.t: output changed |
|
754 | 754 | # Ran 2 tests, 0 skipped, 1 failed. |
|
755 | 755 | python hash seed: * (glob) |
|
756 | 756 | [1] |
|
757 | 757 | |
|
758 | 758 | Accept the fix |
|
759 | 759 | |
|
760 | 760 | $ cat >> test-failure.t <<EOF |
|
761 | 761 | > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' |
|
762 | 762 | > saved backup bundle to \$TESTTMP/foo.hg |
|
763 | 763 | > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' |
|
764 | 764 | > saved backup bundle to $TESTTMP\\foo.hg |
|
765 | 765 | > $ echo 'saved backup bundle to \$TESTTMP/foo.hg' |
|
766 | 766 | > saved backup bundle to \$TESTTMP/*.hg (glob) |
|
767 | 767 | > EOF |
|
768 | 768 | $ echo 'y' | rt -i 2>&1 |
|
769 | 769 | |
|
770 | 770 | --- $TESTTMP/test-failure.t |
|
771 | 771 | +++ $TESTTMP/test-failure.t.err |
|
772 | 772 | @@ -1,5 +1,5 @@ |
|
773 | 773 | $ echo babar |
|
774 | 774 | - rataxes |
|
775 | 775 | + babar |
|
776 | 776 | This is a noop statement so that |
|
777 | 777 | this test is still more bytes than success. |
|
778 | 778 | pad pad pad pad............................................................ |
|
779 | 779 | @@ -11,6 +11,6 @@ |
|
780 | 780 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
781 | 781 | saved backup bundle to $TESTTMP/foo.hg |
|
782 | 782 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
783 | 783 | - saved backup bundle to $TESTTMP\foo.hg |
|
784 | 784 | + saved backup bundle to $TESTTMP/foo.hg |
|
785 | 785 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
786 | 786 | saved backup bundle to $TESTTMP/*.hg (glob) |
|
787 | 787 | Accept this change? [n] .. |
|
788 | 788 | # Ran 2 tests, 0 skipped, 0 failed. |
|
789 | 789 | |
|
790 | 790 | $ sed -e 's,(glob)$,&<,g' test-failure.t |
|
791 | 791 | $ echo babar |
|
792 | 792 | babar |
|
793 | 793 | This is a noop statement so that |
|
794 | 794 | this test is still more bytes than success. |
|
795 | 795 | pad pad pad pad............................................................ |
|
796 | 796 | pad pad pad pad............................................................ |
|
797 | 797 | pad pad pad pad............................................................ |
|
798 | 798 | pad pad pad pad............................................................ |
|
799 | 799 | pad pad pad pad............................................................ |
|
800 | 800 | pad pad pad pad............................................................ |
|
801 | 801 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
802 | 802 | saved backup bundle to $TESTTMP/foo.hg |
|
803 | 803 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
804 | 804 | saved backup bundle to $TESTTMP/foo.hg |
|
805 | 805 | $ echo 'saved backup bundle to $TESTTMP/foo.hg' |
|
806 | 806 | saved backup bundle to $TESTTMP/*.hg (glob)< |
|
807 | 807 | |
|
808 | 808 | Race condition - test file was modified when test is running |
|
809 | 809 | |
|
810 | 810 | $ TESTRACEDIR=`pwd` |
|
811 | 811 | $ export TESTRACEDIR |
|
812 | 812 | $ cat > test-race.t <<EOF |
|
813 | 813 | > $ echo 1 |
|
814 | 814 | > $ echo "# a new line" >> $TESTRACEDIR/test-race.t |
|
815 | 815 | > EOF |
|
816 | 816 | |
|
817 | 817 | $ rt -i test-race.t |
|
818 | 818 | |
|
819 | 819 | --- $TESTTMP/test-race.t |
|
820 | 820 | +++ $TESTTMP/test-race.t.err |
|
821 | 821 | @@ -1,2 +1,3 @@ |
|
822 | 822 | $ echo 1 |
|
823 | 823 | + 1 |
|
824 | 824 | $ echo "# a new line" >> $TESTTMP/test-race.t |
|
825 | 825 | Reference output has changed (run again to prompt changes) |
|
826 | 826 | ERROR: test-race.t output changed |
|
827 | 827 | ! |
|
828 | 828 | Failed test-race.t: output changed |
|
829 | 829 | # Ran 1 tests, 0 skipped, 1 failed. |
|
830 | 830 | python hash seed: * (glob) |
|
831 | 831 | [1] |
|
832 | 832 | |
|
833 | 833 | $ rm test-race.t |
|
834 | 834 | |
|
835 | 835 | When "#testcases" is used in .t files |
|
836 | 836 | |
|
837 | 837 | $ cat >> test-cases.t <<EOF |
|
838 | 838 | > #testcases a b |
|
839 | 839 | > #if a |
|
840 | 840 | > $ echo 1 |
|
841 | 841 | > #endif |
|
842 | 842 | > #if b |
|
843 | 843 | > $ echo 2 |
|
844 | 844 | > #endif |
|
845 | 845 | > EOF |
|
846 | 846 | |
|
847 | 847 | $ cat <<EOF | rt -i test-cases.t 2>&1 |
|
848 | 848 | > y |
|
849 | 849 | > y |
|
850 | 850 | > EOF |
|
851 | 851 | |
|
852 | 852 | --- $TESTTMP/test-cases.t |
|
853 | 853 | +++ $TESTTMP/test-cases.t.a.err |
|
854 | 854 | @@ -1,6 +1,7 @@ |
|
855 | 855 | #testcases a b |
|
856 | 856 | #if a |
|
857 | 857 | $ echo 1 |
|
858 | 858 | + 1 |
|
859 | 859 | #endif |
|
860 | 860 | #if b |
|
861 | 861 | $ echo 2 |
|
862 | 862 | Accept this change? [n] . |
|
863 | 863 | --- $TESTTMP/test-cases.t |
|
864 | 864 | +++ $TESTTMP/test-cases.t.b.err |
|
865 | 865 | @@ -5,4 +5,5 @@ |
|
866 | 866 | #endif |
|
867 | 867 | #if b |
|
868 | 868 | $ echo 2 |
|
869 | 869 | + 2 |
|
870 | 870 | #endif |
|
871 | 871 | Accept this change? [n] . |
|
872 | 872 | # Ran 2 tests, 0 skipped, 0 failed. |
|
873 | 873 | |
|
874 | 874 | $ cat test-cases.t |
|
875 | 875 | #testcases a b |
|
876 | 876 | #if a |
|
877 | 877 | $ echo 1 |
|
878 | 878 | 1 |
|
879 | 879 | #endif |
|
880 | 880 | #if b |
|
881 | 881 | $ echo 2 |
|
882 | 882 | 2 |
|
883 | 883 | #endif |
|
884 | 884 | |
|
885 | 885 | $ cat >> test-cases.t <<'EOF' |
|
886 | 886 | > #if a |
|
887 | 887 | > $ NAME=A |
|
888 | 888 | > #else |
|
889 | 889 | > $ NAME=B |
|
890 | 890 | > #endif |
|
891 | 891 | > $ echo $NAME |
|
892 | 892 | > A (a !) |
|
893 | 893 | > B (b !) |
|
894 | 894 | > EOF |
|
895 | 895 | $ rt test-cases.t |
|
896 | 896 | .. |
|
897 | 897 | # Ran 2 tests, 0 skipped, 0 failed. |
|
898 | 898 | |
|
899 | 899 | $ rm test-cases.t |
|
900 | 900 | |
|
901 | 901 | (reinstall) |
|
902 | 902 | $ mv backup test-failure.t |
|
903 | 903 | |
|
904 | 904 | No Diff |
|
905 | 905 | =============== |
|
906 | 906 | |
|
907 | 907 | $ rt --nodiff |
|
908 | 908 | !. |
|
909 | 909 | Failed test-failure.t: output changed |
|
910 | 910 | # Ran 2 tests, 0 skipped, 1 failed. |
|
911 | 911 | python hash seed: * (glob) |
|
912 | 912 | [1] |
|
913 | 913 | |
|
914 | 914 | test --tmpdir support |
|
915 | 915 | $ rt --tmpdir=$TESTTMP/keep test-success.t |
|
916 | 916 | |
|
917 | 917 | Keeping testtmp dir: $TESTTMP/keep/child1/test-success.t |
|
918 | 918 | Keeping threadtmp dir: $TESTTMP/keep/child1 |
|
919 | 919 | . |
|
920 | 920 | # Ran 1 tests, 0 skipped, 0 failed. |
|
921 | 921 | |
|
922 | 922 | timeouts |
|
923 | 923 | ======== |
|
924 | 924 | $ cat > test-timeout.t <<EOF |
|
925 | 925 | > $ sleep 2 |
|
926 | 926 | > $ echo pass |
|
927 | 927 | > pass |
|
928 | 928 | > EOF |
|
929 | 929 | > echo '#require slow' > test-slow-timeout.t |
|
930 | 930 | > cat test-timeout.t >> test-slow-timeout.t |
|
931 | 931 | $ rt --timeout=1 --slowtimeout=3 test-timeout.t test-slow-timeout.t |
|
932 | 932 | st |
|
933 | 933 | Skipped test-slow-timeout.t: missing feature: allow slow tests (use --allow-slow-tests) |
|
934 | 934 | Failed test-timeout.t: timed out |
|
935 | 935 | # Ran 1 tests, 1 skipped, 1 failed. |
|
936 | 936 | python hash seed: * (glob) |
|
937 | 937 | [1] |
|
938 | 938 | $ rt --timeout=1 --slowtimeout=3 \ |
|
939 | 939 | > test-timeout.t test-slow-timeout.t --allow-slow-tests |
|
940 | 940 | .t |
|
941 | 941 | Failed test-timeout.t: timed out |
|
942 | 942 | # Ran 2 tests, 0 skipped, 1 failed. |
|
943 | 943 | python hash seed: * (glob) |
|
944 | 944 | [1] |
|
945 | 945 | $ rm test-timeout.t test-slow-timeout.t |
|
946 | 946 | |
|
947 | 947 | test for --time |
|
948 | 948 | ================== |
|
949 | 949 | |
|
950 | 950 | $ rt test-success.t --time |
|
951 | 951 | . |
|
952 | 952 | # Ran 1 tests, 0 skipped, 0 failed. |
|
953 | 953 | # Producing time report |
|
954 | 954 | start end cuser csys real Test |
|
955 | 955 | \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) |
|
956 | 956 | |
|
957 | 957 | test for --time with --job enabled |
|
958 | 958 | ==================================== |
|
959 | 959 | |
|
960 | 960 | $ rt test-success.t --time --jobs 2 |
|
961 | 961 | . |
|
962 | 962 | # Ran 1 tests, 0 skipped, 0 failed. |
|
963 | 963 | # Producing time report |
|
964 | 964 | start end cuser csys real Test |
|
965 | 965 | \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) |
|
966 | 966 | |
|
967 | 967 | Skips |
|
968 | 968 | ================ |
|
969 | 969 | $ cat > test-skip.t <<EOF |
|
970 | 970 | > $ echo xyzzy |
|
971 | 971 | > #if true |
|
972 | 972 | > #require false |
|
973 | 973 | > #end |
|
974 | 974 | > EOF |
|
975 | 975 | $ cat > test-noskip.t <<EOF |
|
976 | 976 | > #if false |
|
977 | 977 | > #require false |
|
978 | 978 | > #endif |
|
979 | 979 | > EOF |
|
980 | 980 | $ rt --nodiff |
|
981 | 981 | !.s. |
|
982 | 982 | Skipped test-skip.t: missing feature: nail clipper |
|
983 | 983 | Failed test-failure.t: output changed |
|
984 | 984 | # Ran 3 tests, 1 skipped, 1 failed. |
|
985 | 985 | python hash seed: * (glob) |
|
986 | 986 | [1] |
|
987 | 987 | |
|
988 | 988 | $ rm test-noskip.t |
|
989 | 989 | $ rt --keyword xyzzy |
|
990 | 990 | .s |
|
991 | 991 | Skipped test-skip.t: missing feature: nail clipper |
|
992 | 992 | # Ran 2 tests, 2 skipped, 0 failed. |
|
993 | 993 | |
|
994 | 994 | Skips with xml |
|
995 | 995 | $ rt --keyword xyzzy \ |
|
996 | 996 | > --xunit=xunit.xml |
|
997 | 997 | .s |
|
998 | 998 | Skipped test-skip.t: missing feature: nail clipper |
|
999 | 999 | # Ran 2 tests, 2 skipped, 0 failed. |
|
1000 | 1000 | $ cat xunit.xml |
|
1001 | 1001 | <?xml version="1.0" encoding="utf-8"?> |
|
1002 | 1002 | <testsuite errors="0" failures="0" name="run-tests" skipped="2" tests="2"> |
|
1003 | 1003 | <testcase name="test-success.t" time="*"/> (glob) |
|
1004 | 1004 | <testcase name="test-skip.t"> |
|
1005 | 1005 | <skipped> |
|
1006 | 1006 | <![CDATA[missing feature: nail clipper]]> </skipped> |
|
1007 | 1007 | </testcase> |
|
1008 | 1008 | </testsuite> |
|
1009 | 1009 | |
|
1010 | 1010 | Missing skips or blacklisted skips don't count as executed: |
|
1011 | 1011 | $ echo test-failure.t > blacklist |
|
1012 | 1012 | $ rt --blacklist=blacklist --json\ |
|
1013 | 1013 | > test-failure.t test-bogus.t |
|
1014 | 1014 | ss |
|
1015 | 1015 | Skipped test-bogus.t: Doesn't exist |
|
1016 | 1016 | Skipped test-failure.t: blacklisted |
|
1017 | 1017 | # Ran 0 tests, 2 skipped, 0 failed. |
|
1018 | 1018 | $ cat report.json |
|
1019 | 1019 | testreport ={ |
|
1020 | 1020 | "test-bogus.t": { |
|
1021 | 1021 | "result": "skip" |
|
1022 | 1022 | }, |
|
1023 | 1023 | "test-failure.t": { |
|
1024 | 1024 | "result": "skip" |
|
1025 | 1025 | } |
|
1026 | 1026 | } (no-eol) |
|
1027 | 1027 | |
|
1028 | 1028 | Whitelist trumps blacklist |
|
1029 | 1029 | $ echo test-failure.t > whitelist |
|
1030 | 1030 | $ rt --blacklist=blacklist --whitelist=whitelist --json\ |
|
1031 | 1031 | > test-failure.t test-bogus.t |
|
1032 | 1032 | s |
|
1033 | 1033 | --- $TESTTMP/test-failure.t |
|
1034 | 1034 | +++ $TESTTMP/test-failure.t.err |
|
1035 | 1035 | @@ -1,5 +1,5 @@ |
|
1036 | 1036 | $ echo babar |
|
1037 | 1037 | - rataxes |
|
1038 | 1038 | + babar |
|
1039 | 1039 | This is a noop statement so that |
|
1040 | 1040 | this test is still more bytes than success. |
|
1041 | 1041 | pad pad pad pad............................................................ |
|
1042 | 1042 | |
|
1043 | 1043 | ERROR: test-failure.t output changed |
|
1044 | 1044 | ! |
|
1045 | 1045 | Skipped test-bogus.t: Doesn't exist |
|
1046 | 1046 | Failed test-failure.t: output changed |
|
1047 | 1047 | # Ran 1 tests, 1 skipped, 1 failed. |
|
1048 | 1048 | python hash seed: * (glob) |
|
1049 | 1049 | [1] |
|
1050 | 1050 | |
|
1051 | 1051 | Ensure that --test-list causes only the tests listed in that file to |
|
1052 | 1052 | be executed. |
|
1053 | 1053 | $ echo test-success.t >> onlytest |
|
1054 | 1054 | $ rt --test-list=onlytest |
|
1055 | 1055 | . |
|
1056 | 1056 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1057 | 1057 | $ echo test-bogus.t >> anothertest |
|
1058 | 1058 | $ rt --test-list=onlytest --test-list=anothertest |
|
1059 | 1059 | s. |
|
1060 | 1060 | Skipped test-bogus.t: Doesn't exist |
|
1061 | 1061 | # Ran 1 tests, 1 skipped, 0 failed. |
|
1062 | 1062 | $ rm onlytest anothertest |
|
1063 | 1063 | |
|
1064 | 1064 | test for --json |
|
1065 | 1065 | ================== |
|
1066 | 1066 | |
|
1067 | 1067 | $ rt --json |
|
1068 | 1068 | |
|
1069 | 1069 | --- $TESTTMP/test-failure.t |
|
1070 | 1070 | +++ $TESTTMP/test-failure.t.err |
|
1071 | 1071 | @@ -1,5 +1,5 @@ |
|
1072 | 1072 | $ echo babar |
|
1073 | 1073 | - rataxes |
|
1074 | 1074 | + babar |
|
1075 | 1075 | This is a noop statement so that |
|
1076 | 1076 | this test is still more bytes than success. |
|
1077 | 1077 | pad pad pad pad............................................................ |
|
1078 | 1078 | |
|
1079 | 1079 | ERROR: test-failure.t output changed |
|
1080 | 1080 | !.s |
|
1081 | 1081 | Skipped test-skip.t: missing feature: nail clipper |
|
1082 | 1082 | Failed test-failure.t: output changed |
|
1083 | 1083 | # Ran 2 tests, 1 skipped, 1 failed. |
|
1084 | 1084 | python hash seed: * (glob) |
|
1085 | 1085 | [1] |
|
1086 | 1086 | |
|
1087 | 1087 | $ cat report.json |
|
1088 | 1088 | testreport ={ |
|
1089 | 1089 | "test-failure.t": [\{] (re) |
|
1090 | 1090 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1091 | 1091 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1092 | 1092 | "diff": "---.+\+\+\+.+", ? (re) |
|
1093 | 1093 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1094 | 1094 | "result": "failure", ? (re) |
|
1095 | 1095 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1096 | 1096 | "time": "\s*[\d\.]{4,5}" (re) |
|
1097 | 1097 | }, ? (re) |
|
1098 | 1098 | "test-skip.t": { |
|
1099 | 1099 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1100 | 1100 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1101 | 1101 | "diff": "", ? (re) |
|
1102 | 1102 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1103 | 1103 | "result": "skip", ? (re) |
|
1104 | 1104 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1105 | 1105 | "time": "\s*[\d\.]{4,5}" (re) |
|
1106 | 1106 | }, ? (re) |
|
1107 | 1107 | "test-success.t": [\{] (re) |
|
1108 | 1108 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1109 | 1109 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1110 | 1110 | "diff": "", ? (re) |
|
1111 | 1111 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1112 | 1112 | "result": "success", ? (re) |
|
1113 | 1113 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1114 | 1114 | "time": "\s*[\d\.]{4,5}" (re) |
|
1115 | 1115 | } |
|
1116 | 1116 | } (no-eol) |
|
1117 | 1117 | --json with --outputdir |
|
1118 | 1118 | |
|
1119 | 1119 | $ rm report.json |
|
1120 | 1120 | $ rm -r output |
|
1121 | 1121 | $ mkdir output |
|
1122 | 1122 | $ rt --json --outputdir output |
|
1123 | 1123 | |
|
1124 | 1124 | --- $TESTTMP/test-failure.t |
|
1125 | 1125 | +++ $TESTTMP/output/test-failure.t.err |
|
1126 | 1126 | @@ -1,5 +1,5 @@ |
|
1127 | 1127 | $ echo babar |
|
1128 | 1128 | - rataxes |
|
1129 | 1129 | + babar |
|
1130 | 1130 | This is a noop statement so that |
|
1131 | 1131 | this test is still more bytes than success. |
|
1132 | 1132 | pad pad pad pad............................................................ |
|
1133 | 1133 | |
|
1134 | 1134 | ERROR: test-failure.t output changed |
|
1135 | 1135 | !.s |
|
1136 | 1136 | Skipped test-skip.t: missing feature: nail clipper |
|
1137 | 1137 | Failed test-failure.t: output changed |
|
1138 | 1138 | # Ran 2 tests, 1 skipped, 1 failed. |
|
1139 | 1139 | python hash seed: * (glob) |
|
1140 | 1140 | [1] |
|
1141 | 1141 | $ f report.json |
|
1142 | 1142 | report.json: file not found |
|
1143 | 1143 | $ cat output/report.json |
|
1144 | 1144 | testreport ={ |
|
1145 | 1145 | "test-failure.t": [\{] (re) |
|
1146 | 1146 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1147 | 1147 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1148 | 1148 | "diff": "---.+\+\+\+.+", ? (re) |
|
1149 | 1149 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1150 | 1150 | "result": "failure", ? (re) |
|
1151 | 1151 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1152 | 1152 | "time": "\s*[\d\.]{4,5}" (re) |
|
1153 | 1153 | }, ? (re) |
|
1154 | 1154 | "test-skip.t": { |
|
1155 | 1155 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1156 | 1156 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1157 | 1157 | "diff": "", ? (re) |
|
1158 | 1158 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1159 | 1159 | "result": "skip", ? (re) |
|
1160 | 1160 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1161 | 1161 | "time": "\s*[\d\.]{4,5}" (re) |
|
1162 | 1162 | }, ? (re) |
|
1163 | 1163 | "test-success.t": [\{] (re) |
|
1164 | 1164 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1165 | 1165 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1166 | 1166 | "diff": "", ? (re) |
|
1167 | 1167 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1168 | 1168 | "result": "success", ? (re) |
|
1169 | 1169 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1170 | 1170 | "time": "\s*[\d\.]{4,5}" (re) |
|
1171 | 1171 | } |
|
1172 | 1172 | } (no-eol) |
|
1173 | 1173 | $ ls -a output |
|
1174 | 1174 | . |
|
1175 | 1175 | .. |
|
1176 | 1176 | .testtimes |
|
1177 | 1177 | report.json |
|
1178 | 1178 | test-failure.t.err |
|
1179 | 1179 | |
|
1180 | 1180 | Test that failed test accepted through interactive are properly reported: |
|
1181 | 1181 | |
|
1182 | 1182 | $ cp test-failure.t backup |
|
1183 | 1183 | $ echo y | rt --json -i |
|
1184 | 1184 | |
|
1185 | 1185 | --- $TESTTMP/test-failure.t |
|
1186 | 1186 | +++ $TESTTMP/test-failure.t.err |
|
1187 | 1187 | @@ -1,5 +1,5 @@ |
|
1188 | 1188 | $ echo babar |
|
1189 | 1189 | - rataxes |
|
1190 | 1190 | + babar |
|
1191 | 1191 | This is a noop statement so that |
|
1192 | 1192 | this test is still more bytes than success. |
|
1193 | 1193 | pad pad pad pad............................................................ |
|
1194 | 1194 | Accept this change? [n] ..s |
|
1195 | 1195 | Skipped test-skip.t: missing feature: nail clipper |
|
1196 | 1196 | # Ran 2 tests, 1 skipped, 0 failed. |
|
1197 | 1197 | |
|
1198 | 1198 | $ cat report.json |
|
1199 | 1199 | testreport ={ |
|
1200 | 1200 | "test-failure.t": [\{] (re) |
|
1201 | 1201 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1202 | 1202 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1203 | 1203 | "diff": "", ? (re) |
|
1204 | 1204 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1205 | 1205 | "result": "success", ? (re) |
|
1206 | 1206 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1207 | 1207 | "time": "\s*[\d\.]{4,5}" (re) |
|
1208 | 1208 | }, ? (re) |
|
1209 | 1209 | "test-skip.t": { |
|
1210 | 1210 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1211 | 1211 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1212 | 1212 | "diff": "", ? (re) |
|
1213 | 1213 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1214 | 1214 | "result": "skip", ? (re) |
|
1215 | 1215 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1216 | 1216 | "time": "\s*[\d\.]{4,5}" (re) |
|
1217 | 1217 | }, ? (re) |
|
1218 | 1218 | "test-success.t": [\{] (re) |
|
1219 | 1219 | "csys": "\s*[\d\.]{4,5}", ? (re) |
|
1220 | 1220 | "cuser": "\s*[\d\.]{4,5}", ? (re) |
|
1221 | 1221 | "diff": "", ? (re) |
|
1222 | 1222 | "end": "\s*[\d\.]{4,5}", ? (re) |
|
1223 | 1223 | "result": "success", ? (re) |
|
1224 | 1224 | "start": "\s*[\d\.]{4,5}", ? (re) |
|
1225 | 1225 | "time": "\s*[\d\.]{4,5}" (re) |
|
1226 | 1226 | } |
|
1227 | 1227 | } (no-eol) |
|
1228 | 1228 | $ mv backup test-failure.t |
|
1229 | 1229 | |
|
1230 | 1230 | backslash on end of line with glob matching is handled properly |
|
1231 | 1231 | |
|
1232 | 1232 | $ cat > test-glob-backslash.t << EOF |
|
1233 | 1233 | > $ echo 'foo bar \\' |
|
1234 | 1234 | > foo * \ (glob) |
|
1235 | 1235 | > EOF |
|
1236 | 1236 | |
|
1237 | 1237 | $ rt test-glob-backslash.t |
|
1238 | 1238 | . |
|
1239 | 1239 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1240 | 1240 | |
|
1241 | 1241 | $ rm -f test-glob-backslash.t |
|
1242 | 1242 | |
|
1243 | 1243 | Test globbing of local IP addresses |
|
1244 | 1244 | $ echo 172.16.18.1 |
|
1245 | 1245 | $LOCALIP (glob) |
|
1246 | 1246 | $ echo dead:beef::1 |
|
1247 | 1247 | $LOCALIP (glob) |
|
1248 | 1248 | |
|
1249 | 1249 | Add support for external test formatter |
|
1250 | 1250 | ======================================= |
|
1251 | 1251 | |
|
1252 | 1252 | $ CUSTOM_TEST_RESULT=basic_test_result $PYTHON $TESTDIR/run-tests.py --with-hg=`which hg` "$@" test-success.t test-failure.t |
|
1253 | 1253 | |
|
1254 | 1254 | # Ran 2 tests, 0 skipped, 0 failed. |
|
1255 | ON_START! <__main__.TestSuite tests=[<__main__.TTest testMethod=test-failure.t>, <__main__.TTest testMethod=test-success.t>]> | |
|
1255 | 1256 |
|
|
1256 | 1257 | SUCCESS! test-success.t |
|
1258 | ON_END! | |
|
1257 | 1259 | |
|
1258 | 1260 |
|
|
1259 | 1261 | ====================================== |
|
1260 | 1262 | |
|
1261 | 1263 | $ mkdir "$TESTTMP"/anothertests |
|
1262 | 1264 | $ cd "$TESTTMP"/anothertests |
|
1263 | 1265 | |
|
1264 | 1266 | test that `run-tests.py` can execute hghave, even if it runs not in |
|
1265 | 1267 | Mercurial source tree. |
|
1266 | 1268 | |
|
1267 | 1269 | $ cat > test-hghave.t <<EOF |
|
1268 | 1270 | > #require true |
|
1269 | 1271 | > $ echo foo |
|
1270 | 1272 | > foo |
|
1271 | 1273 | > EOF |
|
1272 | 1274 | $ rt test-hghave.t |
|
1273 | 1275 | . |
|
1274 | 1276 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1275 | 1277 | |
|
1276 | 1278 | test that RUNTESTDIR refers the directory, in which `run-tests.py` now |
|
1277 | 1279 | running is placed. |
|
1278 | 1280 | |
|
1279 | 1281 | $ cat > test-runtestdir.t <<EOF |
|
1280 | 1282 | > - $TESTDIR, in which test-run-tests.t is placed |
|
1281 | 1283 | > - \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime) |
|
1282 | 1284 | > - \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime) |
|
1283 | 1285 | > |
|
1284 | 1286 | > #if windows |
|
1285 | 1287 | > $ test "\$TESTDIR" = "$TESTTMP\anothertests" |
|
1286 | 1288 | > #else |
|
1287 | 1289 | > $ test "\$TESTDIR" = "$TESTTMP"/anothertests |
|
1288 | 1290 | > #endif |
|
1289 | 1291 | > If this prints a path, that means RUNTESTDIR didn't equal |
|
1290 | 1292 | > TESTDIR as it should have. |
|
1291 | 1293 | > $ test "\$RUNTESTDIR" = "$TESTDIR" || echo "\$RUNTESTDIR" |
|
1292 | 1294 | > This should print the start of check-code. If this passes but the |
|
1293 | 1295 | > previous check failed, that means we found a copy of check-code at whatever |
|
1294 | 1296 | > RUNTESTSDIR ended up containing, even though it doesn't match TESTDIR. |
|
1295 | 1297 | > $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py | sed 's@.!.*python@#!USRBINENVPY@' |
|
1296 | 1298 | > #!USRBINENVPY |
|
1297 | 1299 | > # |
|
1298 | 1300 | > # check-code - a style and portability checker for Mercurial |
|
1299 | 1301 | > EOF |
|
1300 | 1302 | $ rt test-runtestdir.t |
|
1301 | 1303 | . |
|
1302 | 1304 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1303 | 1305 | |
|
1304 | 1306 | #if execbit |
|
1305 | 1307 | |
|
1306 | 1308 | test that TESTDIR is referred in PATH |
|
1307 | 1309 | |
|
1308 | 1310 | $ cat > custom-command.sh <<EOF |
|
1309 | 1311 | > #!/bin/sh |
|
1310 | 1312 | > echo "hello world" |
|
1311 | 1313 | > EOF |
|
1312 | 1314 | $ chmod +x custom-command.sh |
|
1313 | 1315 | $ cat > test-testdir-path.t <<EOF |
|
1314 | 1316 | > $ custom-command.sh |
|
1315 | 1317 | > hello world |
|
1316 | 1318 | > EOF |
|
1317 | 1319 | $ rt test-testdir-path.t |
|
1318 | 1320 | . |
|
1319 | 1321 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1320 | 1322 | |
|
1321 | 1323 | #endif |
|
1322 | 1324 | |
|
1323 | 1325 | test support for --allow-slow-tests |
|
1324 | 1326 | $ cat > test-very-slow-test.t <<EOF |
|
1325 | 1327 | > #require slow |
|
1326 | 1328 | > $ echo pass |
|
1327 | 1329 | > pass |
|
1328 | 1330 | > EOF |
|
1329 | 1331 | $ rt test-very-slow-test.t |
|
1330 | 1332 | s |
|
1331 | 1333 | Skipped test-very-slow-test.t: missing feature: allow slow tests (use --allow-slow-tests) |
|
1332 | 1334 | # Ran 0 tests, 1 skipped, 0 failed. |
|
1333 | 1335 | $ rt $HGTEST_RUN_TESTS_PURE --allow-slow-tests test-very-slow-test.t |
|
1334 | 1336 | . |
|
1335 | 1337 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1336 | 1338 | |
|
1337 | 1339 | support for running a test outside the current directory |
|
1338 | 1340 | $ mkdir nonlocal |
|
1339 | 1341 | $ cat > nonlocal/test-is-not-here.t << EOF |
|
1340 | 1342 | > $ echo pass |
|
1341 | 1343 | > pass |
|
1342 | 1344 | > EOF |
|
1343 | 1345 | $ rt nonlocal/test-is-not-here.t |
|
1344 | 1346 | . |
|
1345 | 1347 | # Ran 1 tests, 0 skipped, 0 failed. |
|
1346 | 1348 | |
|
1347 | 1349 | support for automatically discovering test if arg is a folder |
|
1348 | 1350 | $ mkdir tmp && cd tmp |
|
1349 | 1351 | |
|
1350 | 1352 | $ cat > test-uno.t << EOF |
|
1351 | 1353 | > $ echo line |
|
1352 | 1354 | > line |
|
1353 | 1355 | > EOF |
|
1354 | 1356 | |
|
1355 | 1357 | $ cp test-uno.t test-dos.t |
|
1356 | 1358 | $ cd .. |
|
1357 | 1359 | $ cp -R tmp tmpp |
|
1358 | 1360 | $ cp tmp/test-uno.t test-solo.t |
|
1359 | 1361 | |
|
1360 | 1362 | $ rt tmp/ test-solo.t tmpp |
|
1361 | 1363 | ..... |
|
1362 | 1364 | # Ran 5 tests, 0 skipped, 0 failed. |
|
1363 | 1365 | $ rm -rf tmp tmpp |
|
1364 | 1366 | |
|
1365 | 1367 | support for running run-tests.py from another directory |
|
1366 | 1368 | $ mkdir tmp && cd tmp |
|
1367 | 1369 | |
|
1368 | 1370 | $ cat > useful-file.sh << EOF |
|
1369 | 1371 | > important command |
|
1370 | 1372 | > EOF |
|
1371 | 1373 | |
|
1372 | 1374 | $ cat > test-folder.t << EOF |
|
1373 | 1375 | > $ cat \$TESTDIR/useful-file.sh |
|
1374 | 1376 | > important command |
|
1375 | 1377 | > EOF |
|
1376 | 1378 | |
|
1377 | 1379 | $ cat > test-folder-fail.t << EOF |
|
1378 | 1380 | > $ cat \$TESTDIR/useful-file.sh |
|
1379 | 1381 | > important commando |
|
1380 | 1382 | > EOF |
|
1381 | 1383 | |
|
1382 | 1384 | $ cd .. |
|
1383 | 1385 | $ rt tmp/test-*.t |
|
1384 | 1386 | |
|
1385 | 1387 | --- $TESTTMP/anothertests/tmp/test-folder-fail.t |
|
1386 | 1388 | +++ $TESTTMP/anothertests/tmp/test-folder-fail.t.err |
|
1387 | 1389 | @@ -1,2 +1,2 @@ |
|
1388 | 1390 | $ cat $TESTDIR/useful-file.sh |
|
1389 | 1391 | - important commando |
|
1390 | 1392 | + important command |
|
1391 | 1393 | |
|
1392 | 1394 | ERROR: test-folder-fail.t output changed |
|
1393 | 1395 | !. |
|
1394 | 1396 | Failed test-folder-fail.t: output changed |
|
1395 | 1397 | # Ran 2 tests, 0 skipped, 1 failed. |
|
1396 | 1398 | python hash seed: * (glob) |
|
1397 | 1399 | [1] |
|
1398 | 1400 | |
|
1399 | 1401 | support for bisecting failed tests automatically |
|
1400 | 1402 | $ hg init bisect |
|
1401 | 1403 | $ cd bisect |
|
1402 | 1404 | $ cat >> test-bisect.t <<EOF |
|
1403 | 1405 | > $ echo pass |
|
1404 | 1406 | > pass |
|
1405 | 1407 | > EOF |
|
1406 | 1408 | $ hg add test-bisect.t |
|
1407 | 1409 | $ hg ci -m 'good' |
|
1408 | 1410 | $ cat >> test-bisect.t <<EOF |
|
1409 | 1411 | > $ echo pass |
|
1410 | 1412 | > fail |
|
1411 | 1413 | > EOF |
|
1412 | 1414 | $ hg ci -m 'bad' |
|
1413 | 1415 | $ rt --known-good-rev=0 test-bisect.t |
|
1414 | 1416 | |
|
1415 | 1417 | --- $TESTTMP/anothertests/bisect/test-bisect.t |
|
1416 | 1418 | +++ $TESTTMP/anothertests/bisect/test-bisect.t.err |
|
1417 | 1419 | @@ -1,4 +1,4 @@ |
|
1418 | 1420 | $ echo pass |
|
1419 | 1421 | pass |
|
1420 | 1422 | $ echo pass |
|
1421 | 1423 | - fail |
|
1422 | 1424 | + pass |
|
1423 | 1425 | |
|
1424 | 1426 | ERROR: test-bisect.t output changed |
|
1425 | 1427 | ! |
|
1426 | 1428 | Failed test-bisect.t: output changed |
|
1427 | 1429 | test-bisect.t broken by 72cbf122d116 (bad) |
|
1428 | 1430 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1429 | 1431 | python hash seed: * (glob) |
|
1430 | 1432 | [1] |
|
1431 | 1433 | |
|
1432 | 1434 | $ cd .. |
|
1433 | 1435 | |
|
1434 | 1436 | support bisecting a separate repo |
|
1435 | 1437 | |
|
1436 | 1438 | $ hg init bisect-dependent |
|
1437 | 1439 | $ cd bisect-dependent |
|
1438 | 1440 | $ cat > test-bisect-dependent.t <<EOF |
|
1439 | 1441 | > $ tail -1 \$TESTDIR/../bisect/test-bisect.t |
|
1440 | 1442 | > pass |
|
1441 | 1443 | > EOF |
|
1442 | 1444 | $ hg commit -Am dependent test-bisect-dependent.t |
|
1443 | 1445 | |
|
1444 | 1446 | $ rt --known-good-rev=0 test-bisect-dependent.t |
|
1445 | 1447 | |
|
1446 | 1448 | --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t |
|
1447 | 1449 | +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err |
|
1448 | 1450 | @@ -1,2 +1,2 @@ |
|
1449 | 1451 | $ tail -1 $TESTDIR/../bisect/test-bisect.t |
|
1450 | 1452 | - pass |
|
1451 | 1453 | + fail |
|
1452 | 1454 | |
|
1453 | 1455 | ERROR: test-bisect-dependent.t output changed |
|
1454 | 1456 | ! |
|
1455 | 1457 | Failed test-bisect-dependent.t: output changed |
|
1456 | 1458 | Failed to identify failure point for test-bisect-dependent.t |
|
1457 | 1459 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1458 | 1460 | python hash seed: * (glob) |
|
1459 | 1461 | [1] |
|
1460 | 1462 | |
|
1461 | 1463 | $ rt --bisect-repo=../test-bisect test-bisect-dependent.t |
|
1462 | 1464 | usage: run-tests.py [options] [tests] |
|
1463 | 1465 | run-tests.py: error: --bisect-repo cannot be used without --known-good-rev |
|
1464 | 1466 | [2] |
|
1465 | 1467 | |
|
1466 | 1468 | $ rt --known-good-rev=0 --bisect-repo=../bisect test-bisect-dependent.t |
|
1467 | 1469 | |
|
1468 | 1470 | --- $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t |
|
1469 | 1471 | +++ $TESTTMP/anothertests/bisect-dependent/test-bisect-dependent.t.err |
|
1470 | 1472 | @@ -1,2 +1,2 @@ |
|
1471 | 1473 | $ tail -1 $TESTDIR/../bisect/test-bisect.t |
|
1472 | 1474 | - pass |
|
1473 | 1475 | + fail |
|
1474 | 1476 | |
|
1475 | 1477 | ERROR: test-bisect-dependent.t output changed |
|
1476 | 1478 | ! |
|
1477 | 1479 | Failed test-bisect-dependent.t: output changed |
|
1478 | 1480 | test-bisect-dependent.t broken by 72cbf122d116 (bad) |
|
1479 | 1481 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1480 | 1482 | python hash seed: * (glob) |
|
1481 | 1483 | [1] |
|
1482 | 1484 | |
|
1483 | 1485 | $ cd .. |
|
1484 | 1486 | |
|
1485 | 1487 | Test a broken #if statement doesn't break run-tests threading. |
|
1486 | 1488 | ============================================================== |
|
1487 | 1489 | $ mkdir broken |
|
1488 | 1490 | $ cd broken |
|
1489 | 1491 | $ cat > test-broken.t <<EOF |
|
1490 | 1492 | > true |
|
1491 | 1493 | > #if notarealhghavefeature |
|
1492 | 1494 | > $ false |
|
1493 | 1495 | > #endif |
|
1494 | 1496 | > EOF |
|
1495 | 1497 | $ for f in 1 2 3 4 ; do |
|
1496 | 1498 | > cat > test-works-$f.t <<EOF |
|
1497 | 1499 | > This is test case $f |
|
1498 | 1500 | > $ sleep 1 |
|
1499 | 1501 | > EOF |
|
1500 | 1502 | > done |
|
1501 | 1503 | $ rt -j 2 |
|
1502 | 1504 | .... |
|
1503 | 1505 | # Ran 5 tests, 0 skipped, 0 failed. |
|
1504 | 1506 | skipped: unknown feature: notarealhghavefeature |
|
1505 | 1507 | |
|
1506 | 1508 | $ cd .. |
|
1507 | 1509 | $ rm -rf broken |
|
1508 | 1510 | |
|
1509 | 1511 | Test cases in .t files |
|
1510 | 1512 | ====================== |
|
1511 | 1513 | $ mkdir cases |
|
1512 | 1514 | $ cd cases |
|
1513 | 1515 | $ cat > test-cases-abc.t <<'EOF' |
|
1514 | 1516 | > #testcases A B C |
|
1515 | 1517 | > $ V=B |
|
1516 | 1518 | > #if A |
|
1517 | 1519 | > $ V=A |
|
1518 | 1520 | > #endif |
|
1519 | 1521 | > #if C |
|
1520 | 1522 | > $ V=C |
|
1521 | 1523 | > #endif |
|
1522 | 1524 | > $ echo $V | sed 's/A/C/' |
|
1523 | 1525 | > C |
|
1524 | 1526 | > #if C |
|
1525 | 1527 | > $ [ $V = C ] |
|
1526 | 1528 | > #endif |
|
1527 | 1529 | > #if A |
|
1528 | 1530 | > $ [ $V = C ] |
|
1529 | 1531 | > [1] |
|
1530 | 1532 | > #endif |
|
1531 | 1533 | > #if no-C |
|
1532 | 1534 | > $ [ $V = C ] |
|
1533 | 1535 | > [1] |
|
1534 | 1536 | > #endif |
|
1535 | 1537 | > $ [ $V = D ] |
|
1536 | 1538 | > [1] |
|
1537 | 1539 | > EOF |
|
1538 | 1540 | $ rt |
|
1539 | 1541 | . |
|
1540 | 1542 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1541 | 1543 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1542 | 1544 | @@ -7,7 +7,7 @@ |
|
1543 | 1545 | $ V=C |
|
1544 | 1546 | #endif |
|
1545 | 1547 | $ echo $V | sed 's/A/C/' |
|
1546 | 1548 | - C |
|
1547 | 1549 | + B |
|
1548 | 1550 | #if C |
|
1549 | 1551 | $ [ $V = C ] |
|
1550 | 1552 | #endif |
|
1551 | 1553 | |
|
1552 | 1554 | ERROR: test-cases-abc.t#B output changed |
|
1553 | 1555 | !. |
|
1554 | 1556 | Failed test-cases-abc.t#B: output changed |
|
1555 | 1557 | # Ran 3 tests, 0 skipped, 1 failed. |
|
1556 | 1558 | python hash seed: * (glob) |
|
1557 | 1559 | [1] |
|
1558 | 1560 | |
|
1559 | 1561 | --restart works |
|
1560 | 1562 | |
|
1561 | 1563 | $ rt --restart |
|
1562 | 1564 | |
|
1563 | 1565 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1564 | 1566 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1565 | 1567 | @@ -7,7 +7,7 @@ |
|
1566 | 1568 | $ V=C |
|
1567 | 1569 | #endif |
|
1568 | 1570 | $ echo $V | sed 's/A/C/' |
|
1569 | 1571 | - C |
|
1570 | 1572 | + B |
|
1571 | 1573 | #if C |
|
1572 | 1574 | $ [ $V = C ] |
|
1573 | 1575 | #endif |
|
1574 | 1576 | |
|
1575 | 1577 | ERROR: test-cases-abc.t#B output changed |
|
1576 | 1578 | !. |
|
1577 | 1579 | Failed test-cases-abc.t#B: output changed |
|
1578 | 1580 | # Ran 2 tests, 0 skipped, 1 failed. |
|
1579 | 1581 | python hash seed: * (glob) |
|
1580 | 1582 | [1] |
|
1581 | 1583 | |
|
1582 | 1584 | --restart works with outputdir |
|
1583 | 1585 | |
|
1584 | 1586 | $ mkdir output |
|
1585 | 1587 | $ mv test-cases-abc.t.B.err output |
|
1586 | 1588 | $ rt --restart --outputdir output |
|
1587 | 1589 | |
|
1588 | 1590 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1589 | 1591 | +++ $TESTTMP/anothertests/cases/output/test-cases-abc.t.B.err |
|
1590 | 1592 | @@ -7,7 +7,7 @@ |
|
1591 | 1593 | $ V=C |
|
1592 | 1594 | #endif |
|
1593 | 1595 | $ echo $V | sed 's/A/C/' |
|
1594 | 1596 | - C |
|
1595 | 1597 | + B |
|
1596 | 1598 | #if C |
|
1597 | 1599 | $ [ $V = C ] |
|
1598 | 1600 | #endif |
|
1599 | 1601 | |
|
1600 | 1602 | ERROR: test-cases-abc.t#B output changed |
|
1601 | 1603 | !. |
|
1602 | 1604 | Failed test-cases-abc.t#B: output changed |
|
1603 | 1605 | # Ran 2 tests, 0 skipped, 1 failed. |
|
1604 | 1606 | python hash seed: * (glob) |
|
1605 | 1607 | [1] |
|
1606 | 1608 | |
|
1607 | 1609 | Test TESTCASE variable |
|
1608 | 1610 | |
|
1609 | 1611 | $ cat > test-cases-ab.t <<'EOF' |
|
1610 | 1612 | > $ dostuff() { |
|
1611 | 1613 | > > echo "In case $TESTCASE" |
|
1612 | 1614 | > > } |
|
1613 | 1615 | > #testcases A B |
|
1614 | 1616 | > #if A |
|
1615 | 1617 | > $ dostuff |
|
1616 | 1618 | > In case A |
|
1617 | 1619 | > #endif |
|
1618 | 1620 | > #if B |
|
1619 | 1621 | > $ dostuff |
|
1620 | 1622 | > In case B |
|
1621 | 1623 | > #endif |
|
1622 | 1624 | > EOF |
|
1623 | 1625 | $ rt test-cases-ab.t |
|
1624 | 1626 | .. |
|
1625 | 1627 | # Ran 2 tests, 0 skipped, 0 failed. |
|
1626 | 1628 | |
|
1627 | 1629 | Support running a specific test case |
|
1628 | 1630 | |
|
1629 | 1631 | $ rt "test-cases-abc.t#B" |
|
1630 | 1632 | |
|
1631 | 1633 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1632 | 1634 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1633 | 1635 | @@ -7,7 +7,7 @@ |
|
1634 | 1636 | $ V=C |
|
1635 | 1637 | #endif |
|
1636 | 1638 | $ echo $V | sed 's/A/C/' |
|
1637 | 1639 | - C |
|
1638 | 1640 | + B |
|
1639 | 1641 | #if C |
|
1640 | 1642 | $ [ $V = C ] |
|
1641 | 1643 | #endif |
|
1642 | 1644 | |
|
1643 | 1645 | ERROR: test-cases-abc.t#B output changed |
|
1644 | 1646 | ! |
|
1645 | 1647 | Failed test-cases-abc.t#B: output changed |
|
1646 | 1648 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1647 | 1649 | python hash seed: * (glob) |
|
1648 | 1650 | [1] |
|
1649 | 1651 | |
|
1650 | 1652 | Support running multiple test cases in the same file |
|
1651 | 1653 | |
|
1652 | 1654 | $ rt test-cases-abc.t#B test-cases-abc.t#C |
|
1653 | 1655 | |
|
1654 | 1656 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1655 | 1657 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1656 | 1658 | @@ -7,7 +7,7 @@ |
|
1657 | 1659 | $ V=C |
|
1658 | 1660 | #endif |
|
1659 | 1661 | $ echo $V | sed 's/A/C/' |
|
1660 | 1662 | - C |
|
1661 | 1663 | + B |
|
1662 | 1664 | #if C |
|
1663 | 1665 | $ [ $V = C ] |
|
1664 | 1666 | #endif |
|
1665 | 1667 | |
|
1666 | 1668 | ERROR: test-cases-abc.t#B output changed |
|
1667 | 1669 | !. |
|
1668 | 1670 | Failed test-cases-abc.t#B: output changed |
|
1669 | 1671 | # Ran 2 tests, 0 skipped, 1 failed. |
|
1670 | 1672 | python hash seed: * (glob) |
|
1671 | 1673 | [1] |
|
1672 | 1674 | |
|
1673 | 1675 | Support ignoring invalid test cases |
|
1674 | 1676 | |
|
1675 | 1677 | $ rt test-cases-abc.t#B test-cases-abc.t#D |
|
1676 | 1678 | |
|
1677 | 1679 | --- $TESTTMP/anothertests/cases/test-cases-abc.t |
|
1678 | 1680 | +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err |
|
1679 | 1681 | @@ -7,7 +7,7 @@ |
|
1680 | 1682 | $ V=C |
|
1681 | 1683 | #endif |
|
1682 | 1684 | $ echo $V | sed 's/A/C/' |
|
1683 | 1685 | - C |
|
1684 | 1686 | + B |
|
1685 | 1687 | #if C |
|
1686 | 1688 | $ [ $V = C ] |
|
1687 | 1689 | #endif |
|
1688 | 1690 | |
|
1689 | 1691 | ERROR: test-cases-abc.t#B output changed |
|
1690 | 1692 | ! |
|
1691 | 1693 | Failed test-cases-abc.t#B: output changed |
|
1692 | 1694 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1693 | 1695 | python hash seed: * (glob) |
|
1694 | 1696 | [1] |
|
1695 | 1697 | |
|
1696 | 1698 | Support running complex test cases names |
|
1697 | 1699 | |
|
1698 | 1700 | $ cat > test-cases-advanced-cases.t <<'EOF' |
|
1699 | 1701 | > #testcases simple case-with-dashes casewith_-.chars |
|
1700 | 1702 | > $ echo $TESTCASE |
|
1701 | 1703 | > simple |
|
1702 | 1704 | > EOF |
|
1703 | 1705 | |
|
1704 | 1706 | $ cat test-cases-advanced-cases.t |
|
1705 | 1707 | #testcases simple case-with-dashes casewith_-.chars |
|
1706 | 1708 | $ echo $TESTCASE |
|
1707 | 1709 | simple |
|
1708 | 1710 | |
|
1709 | 1711 | $ rt test-cases-advanced-cases.t |
|
1710 | 1712 | |
|
1711 | 1713 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t |
|
1712 | 1714 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err |
|
1713 | 1715 | @@ -1,3 +1,3 @@ |
|
1714 | 1716 | #testcases simple case-with-dashes casewith_-.chars |
|
1715 | 1717 | $ echo $TESTCASE |
|
1716 | 1718 | - simple |
|
1717 | 1719 | + case-with-dashes |
|
1718 | 1720 | |
|
1719 | 1721 | ERROR: test-cases-advanced-cases.t#case-with-dashes output changed |
|
1720 | 1722 | ! |
|
1721 | 1723 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t |
|
1722 | 1724 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith_-.chars.err |
|
1723 | 1725 | @@ -1,3 +1,3 @@ |
|
1724 | 1726 | #testcases simple case-with-dashes casewith_-.chars |
|
1725 | 1727 | $ echo $TESTCASE |
|
1726 | 1728 | - simple |
|
1727 | 1729 | + casewith_-.chars |
|
1728 | 1730 | |
|
1729 | 1731 | ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed |
|
1730 | 1732 | !. |
|
1731 | 1733 | Failed test-cases-advanced-cases.t#case-with-dashes: output changed |
|
1732 | 1734 | Failed test-cases-advanced-cases.t#casewith_-.chars: output changed |
|
1733 | 1735 | # Ran 3 tests, 0 skipped, 2 failed. |
|
1734 | 1736 | python hash seed: * (glob) |
|
1735 | 1737 | [1] |
|
1736 | 1738 | |
|
1737 | 1739 | $ rt "test-cases-advanced-cases.t#case-with-dashes" |
|
1738 | 1740 | |
|
1739 | 1741 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t |
|
1740 | 1742 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err |
|
1741 | 1743 | @@ -1,3 +1,3 @@ |
|
1742 | 1744 | #testcases simple case-with-dashes casewith_-.chars |
|
1743 | 1745 | $ echo $TESTCASE |
|
1744 | 1746 | - simple |
|
1745 | 1747 | + case-with-dashes |
|
1746 | 1748 | |
|
1747 | 1749 | ERROR: test-cases-advanced-cases.t#case-with-dashes output changed |
|
1748 | 1750 | ! |
|
1749 | 1751 | Failed test-cases-advanced-cases.t#case-with-dashes: output changed |
|
1750 | 1752 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1751 | 1753 | python hash seed: * (glob) |
|
1752 | 1754 | [1] |
|
1753 | 1755 | |
|
1754 | 1756 | $ rt "test-cases-advanced-cases.t#casewith_-.chars" |
|
1755 | 1757 | |
|
1756 | 1758 | --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t |
|
1757 | 1759 | +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith_-.chars.err |
|
1758 | 1760 | @@ -1,3 +1,3 @@ |
|
1759 | 1761 | #testcases simple case-with-dashes casewith_-.chars |
|
1760 | 1762 | $ echo $TESTCASE |
|
1761 | 1763 | - simple |
|
1762 | 1764 | + casewith_-.chars |
|
1763 | 1765 | |
|
1764 | 1766 | ERROR: test-cases-advanced-cases.t#casewith_-.chars output changed |
|
1765 | 1767 | ! |
|
1766 | 1768 | Failed test-cases-advanced-cases.t#casewith_-.chars: output changed |
|
1767 | 1769 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1768 | 1770 | python hash seed: * (glob) |
|
1769 | 1771 | [1] |
|
1770 | 1772 | |
|
1771 | 1773 | Test automatic pattern replacement |
|
1772 | 1774 | ================================== |
|
1773 | 1775 | |
|
1774 | 1776 | $ cat << EOF >> common-pattern.py |
|
1775 | 1777 | > substitutions = [ |
|
1776 | 1778 | > (br'foo-(.*)\\b', |
|
1777 | 1779 | > br'\$XXX=\\1\$'), |
|
1778 | 1780 | > (br'bar\\n', |
|
1779 | 1781 | > br'\$YYY$\\n'), |
|
1780 | 1782 | > ] |
|
1781 | 1783 | > EOF |
|
1782 | 1784 | |
|
1783 | 1785 | $ cat << EOF >> test-substitution.t |
|
1784 | 1786 | > $ echo foo-12 |
|
1785 | 1787 | > \$XXX=12$ |
|
1786 | 1788 | > $ echo foo-42 |
|
1787 | 1789 | > \$XXX=42$ |
|
1788 | 1790 | > $ echo bar prior |
|
1789 | 1791 | > bar prior |
|
1790 | 1792 | > $ echo lastbar |
|
1791 | 1793 | > last\$YYY$ |
|
1792 | 1794 | > $ echo foo-bar foo-baz |
|
1793 | 1795 | > EOF |
|
1794 | 1796 | |
|
1795 | 1797 | $ rt test-substitution.t |
|
1796 | 1798 | |
|
1797 | 1799 | --- $TESTTMP/anothertests/cases/test-substitution.t |
|
1798 | 1800 | +++ $TESTTMP/anothertests/cases/test-substitution.t.err |
|
1799 | 1801 | @@ -7,3 +7,4 @@ |
|
1800 | 1802 | $ echo lastbar |
|
1801 | 1803 | last$YYY$ |
|
1802 | 1804 | $ echo foo-bar foo-baz |
|
1803 | 1805 | + $XXX=bar foo-baz$ |
|
1804 | 1806 | |
|
1805 | 1807 | ERROR: test-substitution.t output changed |
|
1806 | 1808 | ! |
|
1807 | 1809 | Failed test-substitution.t: output changed |
|
1808 | 1810 | # Ran 1 tests, 0 skipped, 1 failed. |
|
1809 | 1811 | python hash seed: * (glob) |
|
1810 | 1812 | [1] |
|
1811 | 1813 | |
|
1812 | 1814 | --extra-config-opt works |
|
1813 | 1815 | |
|
1814 | 1816 | $ cat << EOF >> test-config-opt.t |
|
1815 | 1817 | > $ hg init test-config-opt |
|
1816 | 1818 | > $ hg -R test-config-opt purge |
|
1817 | 1819 | > EOF |
|
1818 | 1820 | |
|
1819 | 1821 | $ rt --extra-config-opt extensions.purge= test-config-opt.t |
|
1820 | 1822 | . |
|
1821 | 1823 | # Ran 1 tests, 0 skipped, 0 failed. |
General Comments 0
You need to be logged in to leave comments.
Login now