comparison tests/test-run-tests.t @ 25472:4d2b9b304ad0

tests: drop explicit $TESTDIR from executables $TESTDIR is added to the path, so this is superfluous. Also, inconsistent use of quotes means we might have broken on tests with paths containing spaces.
author Matt Mackall <mpm@selenic.com>
date Mon, 08 Jun 2015 14:44:30 -0500
parents 6025cac3d02f
children 905c32321cfb
comparison
equal deleted inserted replaced
25470:378a8e700e02 25472:4d2b9b304ad0
8 $ unset HGTEST_SHELL 8 $ unset HGTEST_SHELL
9 9
10 Smoke test 10 Smoke test
11 ============ 11 ============
12 12
13 $ $TESTDIR/run-tests.py $HGTEST_RUN_TESTS_PURE 13 $ run-tests.py $HGTEST_RUN_TESTS_PURE
14 14
15 # Ran 0 tests, 0 skipped, 0 warned, 0 failed. 15 # Ran 0 tests, 0 skipped, 0 warned, 0 failed.
16 16
17 a succesful test 17 a succesful test
18 ======================= 18 =======================
24 > never happens (?) 24 > never happens (?)
25 > xyzzy 25 > xyzzy
26 > nor this (?) 26 > nor this (?)
27 > EOF 27 > EOF
28 28
29 $ $TESTDIR/run-tests.py --with-hg=`which hg` 29 $ run-tests.py --with-hg=`which hg`
30 . 30 .
31 # Ran 1 tests, 0 skipped, 0 warned, 0 failed. 31 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
32 32
33 failing test 33 failing test
34 ================== 34 ==================
42 42
43 >>> fh = open('test-failure-unicode.t', 'wb') 43 >>> fh = open('test-failure-unicode.t', 'wb')
44 >>> fh.write(u' $ echo babar\u03b1\n'.encode('utf-8')) and None 44 >>> fh.write(u' $ echo babar\u03b1\n'.encode('utf-8')) and None
45 >>> fh.write(u' l\u03b5\u03b5t\n'.encode('utf-8')) and None 45 >>> fh.write(u' l\u03b5\u03b5t\n'.encode('utf-8')) and None
46 46
47 $ $TESTDIR/run-tests.py --with-hg=`which hg` 47 $ run-tests.py --with-hg=`which hg`
48 48
49 --- $TESTTMP/test-failure.t 49 --- $TESTTMP/test-failure.t
50 +++ $TESTTMP/test-failure.t.err 50 +++ $TESTTMP/test-failure.t.err
51 @@ -1,4 +1,4 @@ 51 @@ -1,4 +1,4 @@
52 $ echo babar 52 $ echo babar
71 # Ran 3 tests, 0 skipped, 0 warned, 2 failed. 71 # Ran 3 tests, 0 skipped, 0 warned, 2 failed.
72 python hash seed: * (glob) 72 python hash seed: * (glob)
73 [1] 73 [1]
74 74
75 test --xunit support 75 test --xunit support
76 $ $TESTDIR/run-tests.py --with-hg=`which hg` --xunit=xunit.xml 76 $ run-tests.py --with-hg=`which hg` --xunit=xunit.xml
77 77
78 --- $TESTTMP/test-failure.t 78 --- $TESTTMP/test-failure.t
79 +++ $TESTTMP/test-failure.t.err 79 +++ $TESTTMP/test-failure.t.err
80 @@ -1,4 +1,4 @@ 80 @@ -1,4 +1,4 @@
81 $ echo babar 81 $ echo babar
127 $ rm test-failure-unicode.t 127 $ rm test-failure-unicode.t
128 128
129 test for --retest 129 test for --retest
130 ==================== 130 ====================
131 131
132 $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest 132 $ run-tests.py --with-hg=`which hg` --retest
133 133
134 --- $TESTTMP/test-failure.t 134 --- $TESTTMP/test-failure.t
135 +++ $TESTTMP/test-failure.t.err 135 +++ $TESTTMP/test-failure.t.err
136 @@ -1,4 +1,4 @@ 136 @@ -1,4 +1,4 @@
137 $ echo babar 137 $ echo babar
150 Selecting Tests To Run 150 Selecting Tests To Run
151 ====================== 151 ======================
152 152
153 successful 153 successful
154 154
155 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t 155 $ run-tests.py --with-hg=`which hg` test-success.t
156 . 156 .
157 # Ran 1 tests, 0 skipped, 0 warned, 0 failed. 157 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
158 158
159 success w/ keyword 159 success w/ keyword
160 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k xyzzy 160 $ run-tests.py --with-hg=`which hg` -k xyzzy
161 . 161 .
162 # Ran 2 tests, 1 skipped, 0 warned, 0 failed. 162 # Ran 2 tests, 1 skipped, 0 warned, 0 failed.
163 163
164 failed 164 failed
165 165
166 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t 166 $ run-tests.py --with-hg=`which hg` test-failure.t
167 167
168 --- $TESTTMP/test-failure.t 168 --- $TESTTMP/test-failure.t
169 +++ $TESTTMP/test-failure.t.err 169 +++ $TESTTMP/test-failure.t.err
170 @@ -1,4 +1,4 @@ 170 @@ -1,4 +1,4 @@
171 $ echo babar 171 $ echo babar
180 # Ran 1 tests, 0 skipped, 0 warned, 1 failed. 180 # Ran 1 tests, 0 skipped, 0 warned, 1 failed.
181 python hash seed: * (glob) 181 python hash seed: * (glob)
182 [1] 182 [1]
183 183
184 failure w/ keyword 184 failure w/ keyword
185 $ $TESTDIR/run-tests.py --with-hg=`which hg` -k rataxes 185 $ run-tests.py --with-hg=`which hg` -k rataxes
186 186
187 --- $TESTTMP/test-failure.t 187 --- $TESTTMP/test-failure.t
188 +++ $TESTTMP/test-failure.t.err 188 +++ $TESTTMP/test-failure.t.err
189 @@ -1,4 +1,4 @@ 189 @@ -1,4 +1,4 @@
190 $ echo babar 190 $ echo babar
206 it's actually the same test being reported for failure twice. 206 it's actually the same test being reported for failure twice.
207 207
208 $ cat > test-serve-fail.t <<EOF 208 $ cat > test-serve-fail.t <<EOF
209 > $ echo 'abort: child process failed to start blah' 209 > $ echo 'abort: child process failed to start blah'
210 > EOF 210 > EOF
211 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-serve-fail.t 211 $ run-tests.py --with-hg=`which hg` test-serve-fail.t
212 212
213 ERROR: test-serve-fail.t output changed 213 ERROR: test-serve-fail.t output changed
214 ! 214 !
215 ERROR: test-serve-fail.t output changed 215 ERROR: test-serve-fail.t output changed
216 ! 216 !
222 $ rm test-serve-fail.t 222 $ rm test-serve-fail.t
223 223
224 Running In Debug Mode 224 Running In Debug Mode
225 ====================== 225 ======================
226 226
227 $ $TESTDIR/run-tests.py --with-hg=`which hg` --debug 2>&1 | grep -v pwd 227 $ run-tests.py --with-hg=`which hg` --debug 2>&1 | grep -v pwd
228 + echo *SALT* 0 0 (glob) 228 + echo *SALT* 0 0 (glob)
229 *SALT* 0 0 (glob) 229 *SALT* 0 0 (glob)
230 + echo babar 230 + echo babar
231 babar 231 babar
232 + echo *SALT* 4 0 (glob) 232 + echo *SALT* 4 0 (glob)
248 ============== 248 ==============
249 249
250 (duplicate the failing test to get predictable output) 250 (duplicate the failing test to get predictable output)
251 $ cp test-failure.t test-failure-copy.t 251 $ cp test-failure.t test-failure-copy.t
252 252
253 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t -n 253 $ run-tests.py --with-hg=`which hg` --jobs 2 test-failure*.t -n
254 !! 254 !!
255 Failed test-failure*.t: output changed (glob) 255 Failed test-failure*.t: output changed (glob)
256 Failed test-failure*.t: output changed (glob) 256 Failed test-failure*.t: output changed (glob)
257 # Ran 2 tests, 0 skipped, 0 warned, 2 failed. 257 # Ran 2 tests, 0 skipped, 0 warned, 2 failed.
258 python hash seed: * (glob) 258 python hash seed: * (glob)
260 260
261 failures in parallel with --first should only print one failure 261 failures in parallel with --first should only print one failure
262 >>> f = open('test-nothing.t', 'w') 262 >>> f = open('test-nothing.t', 'w')
263 >>> f.write('foo\n' * 1024) and None 263 >>> f.write('foo\n' * 1024) and None
264 >>> f.write(' $ sleep 1') and None 264 >>> f.write(' $ sleep 1') and None
265 $ $TESTDIR/run-tests.py --with-hg=`which hg` --jobs 2 --first 265 $ run-tests.py --with-hg=`which hg` --jobs 2 --first
266 266
267 --- $TESTTMP/test-failure*.t (glob) 267 --- $TESTTMP/test-failure*.t (glob)
268 +++ $TESTTMP/test-failure*.t.err (glob) 268 +++ $TESTTMP/test-failure*.t.err (glob)
269 @@ -1,4 +1,4 @@ 269 @@ -1,4 +1,4 @@
270 $ echo babar 270 $ echo babar
290 (backup the failing test) 290 (backup the failing test)
291 $ cp test-failure.t backup 291 $ cp test-failure.t backup
292 292
293 Refuse the fix 293 Refuse the fix
294 294
295 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i 295 $ echo 'n' | run-tests.py --with-hg=`which hg` -i
296 296
297 --- $TESTTMP/test-failure.t 297 --- $TESTTMP/test-failure.t
298 +++ $TESTTMP/test-failure.t.err 298 +++ $TESTTMP/test-failure.t.err
299 @@ -1,4 +1,4 @@ 299 @@ -1,4 +1,4 @@
300 $ echo babar 300 $ echo babar
316 This is a noop statement so that 316 This is a noop statement so that
317 this test is still more bytes than success. 317 this test is still more bytes than success.
318 318
319 Interactive with custom view 319 Interactive with custom view
320 320
321 $ echo 'n' | $TESTDIR/run-tests.py --with-hg=`which hg` -i --view echo 321 $ echo 'n' | run-tests.py --with-hg=`which hg` -i --view echo
322 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob) 322 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob)
323 Accept this change? [n]* (glob) 323 Accept this change? [n]* (glob)
324 ERROR: test-failure.t output changed 324 ERROR: test-failure.t output changed
325 !. 325 !.
326 Failed test-failure.t: output changed 326 Failed test-failure.t: output changed
328 python hash seed: * (glob) 328 python hash seed: * (glob)
329 [1] 329 [1]
330 330
331 View the fix 331 View the fix
332 332
333 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` --view echo 333 $ echo 'y' | run-tests.py --with-hg=`which hg` --view echo
334 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob) 334 $TESTTMP/test-failure.t $TESTTMP/test-failure.t.err (glob)
335 335
336 ERROR: test-failure.t output changed 336 ERROR: test-failure.t output changed
337 !. 337 !.
338 Failed test-failure.t: output changed 338 Failed test-failure.t: output changed
346 $ echo " saved backup bundle to \$TESTTMP/foo.hg" >> test-failure.t 346 $ echo " saved backup bundle to \$TESTTMP/foo.hg" >> test-failure.t
347 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t 347 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t
348 $ echo " saved backup bundle to \$TESTTMP/foo.hg (glob)" >> test-failure.t 348 $ echo " saved backup bundle to \$TESTTMP/foo.hg (glob)" >> test-failure.t
349 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t 349 $ echo " $ echo 'saved backup bundle to \$TESTTMP/foo.hg'" >> test-failure.t
350 $ echo " saved backup bundle to \$TESTTMP/*.hg (glob)" >> test-failure.t 350 $ echo " saved backup bundle to \$TESTTMP/*.hg (glob)" >> test-failure.t
351 $ echo 'y' | $TESTDIR/run-tests.py --with-hg=`which hg` -i 2>&1 | \ 351 $ echo 'y' | run-tests.py --with-hg=`which hg` -i 2>&1 | \
352 > sed -e 's,(glob)$,&<,g' 352 > sed -e 's,(glob)$,&<,g'
353 353
354 --- $TESTTMP/test-failure.t 354 --- $TESTTMP/test-failure.t
355 +++ $TESTTMP/test-failure.t.err 355 +++ $TESTTMP/test-failure.t.err
356 @@ -1,9 +1,9 @@ 356 @@ -1,9 +1,9 @@
384 $ mv backup test-failure.t 384 $ mv backup test-failure.t
385 385
386 No Diff 386 No Diff
387 =============== 387 ===============
388 388
389 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff 389 $ run-tests.py --with-hg=`which hg` --nodiff
390 !. 390 !.
391 Failed test-failure.t: output changed 391 Failed test-failure.t: output changed
392 # Ran 2 tests, 0 skipped, 0 warned, 1 failed. 392 # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
393 python hash seed: * (glob) 393 python hash seed: * (glob)
394 [1] 394 [1]
395 395
396 test for --time 396 test for --time
397 ================== 397 ==================
398 398
399 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time 399 $ run-tests.py --with-hg=`which hg` test-success.t --time
400 . 400 .
401 # Ran 1 tests, 0 skipped, 0 warned, 0 failed. 401 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
402 # Producing time report 402 # Producing time report
403 start end cuser csys real Test 403 start end cuser csys real Test
404 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) 404 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
405 405
406 test for --time with --job enabled 406 test for --time with --job enabled
407 ==================================== 407 ====================================
408 408
409 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2 409 $ run-tests.py --with-hg=`which hg` test-success.t --time --jobs 2
410 . 410 .
411 # Ran 1 tests, 0 skipped, 0 warned, 0 failed. 411 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
412 # Producing time report 412 # Producing time report
413 start end cuser csys real Test 413 start end cuser csys real Test
414 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re) 414 \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} \s*[\d\.]{5} test-success.t (re)
417 ================ 417 ================
418 $ cat > test-skip.t <<EOF 418 $ cat > test-skip.t <<EOF
419 > $ echo xyzzy 419 > $ echo xyzzy
420 > #require false 420 > #require false
421 > EOF 421 > EOF
422 $ $TESTDIR/run-tests.py --with-hg=`which hg` --nodiff 422 $ run-tests.py --with-hg=`which hg` --nodiff
423 !.s 423 !.s
424 Skipped test-skip.t: skipped 424 Skipped test-skip.t: skipped
425 Failed test-failure.t: output changed 425 Failed test-failure.t: output changed
426 # Ran 2 tests, 1 skipped, 0 warned, 1 failed. 426 # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
427 python hash seed: * (glob) 427 python hash seed: * (glob)
428 [1] 428 [1]
429 429
430 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy 430 $ run-tests.py --with-hg=`which hg` --keyword xyzzy
431 .s 431 .s
432 Skipped test-skip.t: skipped 432 Skipped test-skip.t: skipped
433 # Ran 2 tests, 2 skipped, 0 warned, 0 failed. 433 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
434 434
435 Skips with xml 435 Skips with xml
436 $ $TESTDIR/run-tests.py --with-hg=`which hg` --keyword xyzzy \ 436 $ run-tests.py --with-hg=`which hg` --keyword xyzzy \
437 > --xunit=xunit.xml 437 > --xunit=xunit.xml
438 .s 438 .s
439 Skipped test-skip.t: skipped 439 Skipped test-skip.t: skipped
440 # Ran 2 tests, 2 skipped, 0 warned, 0 failed. 440 # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
441 $ cat xunit.xml 441 $ cat xunit.xml
444 <testcase name="test-success.t" time="*"/> (glob) 444 <testcase name="test-success.t" time="*"/> (glob)
445 </testsuite> 445 </testsuite>
446 446
447 Missing skips or blacklisted skips don't count as executed: 447 Missing skips or blacklisted skips don't count as executed:
448 $ echo test-failure.t > blacklist 448 $ echo test-failure.t > blacklist
449 $ $TESTDIR/run-tests.py --with-hg=`which hg` --blacklist=blacklist \ 449 $ run-tests.py --with-hg=`which hg` --blacklist=blacklist \
450 > test-failure.t test-bogus.t 450 > test-failure.t test-bogus.t
451 ss 451 ss
452 Skipped test-bogus.t: Doesn't exist 452 Skipped test-bogus.t: Doesn't exist
453 Skipped test-failure.t: blacklisted 453 Skipped test-failure.t: blacklisted
454 # Ran 0 tests, 2 skipped, 0 warned, 0 failed. 454 # Ran 0 tests, 2 skipped, 0 warned, 0 failed.
456 #if json 456 #if json
457 457
458 test for --json 458 test for --json
459 ================== 459 ==================
460 460
461 $ $TESTDIR/run-tests.py --with-hg=`which hg` --json 461 $ run-tests.py --with-hg=`which hg` --json
462 462
463 --- $TESTTMP/test-failure.t 463 --- $TESTTMP/test-failure.t
464 +++ $TESTTMP/test-failure.t.err 464 +++ $TESTTMP/test-failure.t.err
465 @@ -1,4 +1,4 @@ 465 @@ -1,4 +1,4 @@
466 $ echo babar 466 $ echo babar
506 } (no-eol) 506 } (no-eol)
507 507
508 Test that failed test accepted through interactive are properly reported: 508 Test that failed test accepted through interactive are properly reported:
509 509
510 $ cp test-failure.t backup 510 $ cp test-failure.t backup
511 $ echo y | $TESTDIR/run-tests.py --with-hg=`which hg` --json -i 511 $ echo y | run-tests.py --with-hg=`which hg` --json -i
512 512
513 --- $TESTTMP/test-failure.t 513 --- $TESTTMP/test-failure.t
514 +++ $TESTTMP/test-failure.t.err 514 +++ $TESTTMP/test-failure.t.err
515 @@ -1,4 +1,4 @@ 515 @@ -1,4 +1,4 @@
516 $ echo babar 516 $ echo babar
558 $ cat > test-glob-backslash.t << EOF 558 $ cat > test-glob-backslash.t << EOF
559 > $ echo 'foo bar \\' 559 > $ echo 'foo bar \\'
560 > foo * \ (glob) 560 > foo * \ (glob)
561 > EOF 561 > EOF
562 562
563 $ $TESTDIR/run-tests.py --with-hg=`which hg` test-glob-backslash.t 563 $ run-tests.py --with-hg=`which hg` test-glob-backslash.t
564 . 564 .
565 # Ran 1 tests, 0 skipped, 0 warned, 0 failed. 565 # Ran 1 tests, 0 skipped, 0 warned, 0 failed.
566 566
567 $ rm -f test-glob-backslash.t 567 $ rm -f test-glob-backslash.t
568 568