< prev index next >

./runtests.sh

Print this page
rev 113 : Allow start=YYYY-MM-DD in .jcheck/conf; older changesets are not checked


 320 cat >z/.hg/hgrc <<___
 321 [extensions]
 322 jcheck = $(pwd)/jcheck.py
 323 [hooks]
 324 pretxncommit.jcheck=python:jcheck.hook
 325 ___
 326 if HGUSER=$setup_author hg ci -R z -m '1111111: Foo!
 327 Reviewed-by: duke' -d '0 0' \
 328    && HGUSER=$setup_author $HG tag -R z -r tip hsparent
 329 then true; else fail; fi
 330 r=$(expr $r + 1)
 331 
 332 echo "-- $r tags=lax comment check"
 333 touch z/foo
 334 hg add -R z z/foo
 335 HGUSER=$setup_author $HG ci -R z -m "Buggy bug bug bug
 336 Reviewed-by: fang"
 337 if [ $? -eq 0 ]; then fail; fi
 338 r=$(expr $r + 1)
 339 
























































































































































 340 # Summary
 341 
 342 if [ $failures -gt 0 ]; then
 343   echo "-- FAILURES: $failures"
 344 else
 345   echo "-- All tests passed"
 346 fi
 347 [ $failures != 0 ] && exit 1 || exit 0


 320 cat >z/.hg/hgrc <<___
 321 [extensions]
 322 jcheck = $(pwd)/jcheck.py
 323 [hooks]
 324 pretxncommit.jcheck=python:jcheck.hook
 325 ___
 326 if HGUSER=$setup_author hg ci -R z -m '1111111: Foo!
 327 Reviewed-by: duke' -d '0 0' \
 328    && HGUSER=$setup_author $HG tag -R z -r tip hsparent
 329 then true; else fail; fi
 330 r=$(expr $r + 1)
 331 
 332 echo "-- $r tags=lax comment check"
 333 touch z/foo
 334 hg add -R z z/foo
 335 HGUSER=$setup_author $HG ci -R z -m "Buggy bug bug bug
 336 Reviewed-by: fang"
 337 if [ $? -eq 0 ]; then fail; fi
 338 r=$(expr $r + 1)
 339 
 340 # Test start date
 341 
 342 startdate="2016-12-03"
 343 beforedate="2016-12-02"
 344 afterdate="2017-01-01"
 345 futuredate="2029-06-13"
 346 lastbadcs=3 # the first 4 changesets will be bad
 347 lastbadcsafter=1 # the first 2 bad changesets will be after startdate
 348 
 349 rm -rf z
 350 hg init z
 351 mkdir z/.jcheck
 352 cat >z/.jcheck/conf <<___
 353 project=jdk7
 354 bugids=dup
 355 start=2016-12-03
 356 ___
 357 
 358 cat >z/.hg/hgrc <<___
 359 [extensions]
 360 jcheck = $(pwd)/jcheck.py
 361 ___
 362 
 363 # Setup for start tests
 364 
 365 echo "// trailing whitespace " >z/foo.java
 366 hg add -R z z/foo.java
 367 HGUSER=$setup_author hg ci -R z -m '1010101: Bad whitespace, start
 368 Reviewed-by: duke' -d "$startdate"
 369 
 370 echo "// OK" >z/foo.java
 371 HGUSER=$setup_author hg ci -R z -m '1010101: Bad comment, after' -d "$afterdate"
 372 
 373 echo "// trailing whitespace again " >z/foo.java
 374 HGUSER=$setup_author hg ci -R z -m '1010101: Bad whitespace, before
 375 Reviewed-by: duke' -d "$beforedate"
 376 
 377 echo "// OK again" >z/foo.java
 378 HGUSER=$setup_author hg ci -R z -m '1010101: Bad comment, epoch' -d "0 0"
 379 
 380 echo "// good 1" >z/foo.java
 381 HGUSER=$setup_author hg ci -R z -m '1010101: Good, start
 382 Reviewed-by: duke' -d "$startdate"
 383 
 384 echo "// good 2" >z/foo.java
 385 HGUSER=$setup_author hg ci -R z -m '1010101: Good, after
 386 Reviewed-by: duke' -d "$afterdate"
 387 
 388 echo "// good 3" >z/foo.java
 389 HGUSER=$setup_author hg ci -R z -m '1010101: Good, future
 390 Reviewed-by: duke' -d "$futuredate"
 391 
 392 echo "// good 4" >z/foo.java
 393 HGUSER=$setup_author hg ci -R z -m '1010101: Good, before
 394 Reviewed-by: duke' -d "$beforedate"
 395 
 396 echo "// good 5" >z/foo.java
 397 HGUSER=$setup_author hg ci -R z -m '1010101: Good, epoch
 398 Reviewed-by: duke' -d "0 0"
 399 
 400 last=$(hg -R z tip --template '{rev}')
 401 
 402 cs=0
 403 while [ $cs -le $last ]; do
 404     echo "-- $r start=startdate $cs"
 405     if [ $cs -le $lastbadcsafter ]; then
 406         if hg jcheck -R z -r $cs; then fail; fi
 407     else
 408         if hg jcheck -R z -r $cs; then true; else fail; fi
 409     fi
 410     cs=$(expr $cs + 1)
 411     r=$(expr $r + 1)
 412 done
 413 
 414 cat >z/.jcheck/conf <<___
 415 project=jdk7
 416 bugids=dup
 417 #start=2016-12-03
 418 ___
 419 
 420 cs=0
 421 while [ $cs -le $last ]; do
 422     echo "-- $r no start $cs"
 423     if [ $cs -le $lastbadcs ]; then
 424         if hg jcheck -R z -r $cs; then fail; fi
 425     else
 426         if hg jcheck -R z -r $cs; then true; else fail; fi
 427     fi
 428     cs=$(expr $cs + 1)
 429     r=$(expr $r + 1)
 430 done
 431 
 432 cat >z/.jcheck/conf <<___
 433 project=jdk7
 434 bugids=dup
 435 start=2020-01-01
 436 ___
 437 
 438 echo "-- $r start=future"
 439 if hg jcheck -R z -r 0:tip; then true; else fail; fi
 440 r=$(expr $r + 1)
 441 
 442 # Test start date with black/white lists
 443 
 444 startblack1hash=653767250c06f5aa9663a984527a8c2a4802d7e7
 445 startblack2hash=ed4868afdc9d7fea51dde3e6e0837c8b3b0bbb25
 446 startwhitehash=e069abe6033c0e2df987f227b4a57400049db0cd
 447 rm -rf z
 448 hg init z
 449 mkdir z/.jcheck
 450 cat >z/.jcheck/conf <<___
 451 project=jdk7
 452 bugids=dup
 453 start=2017-09-01
 454 ___
 455 
 456 cat >z/.hg/hgrc <<___
 457 [extensions]
 458 jcheck_test = $(pwd)/jcheck_test.py
 459 ___
 460 
 461 echo "-- $r start black 1"
 462 echo foo >z/foo
 463 hg add -R z z/foo
 464 HGUSER=$setup_author hg ci -R z -m '1010101: Good, before start, but black
 465 Reviewed-by: duke' -d '2017-08-30'
 466 if hg jcheck_test --black $startblack1hash -R z -r tip; then fail; fi
 467 r=$(expr $r + 1)
 468 
 469 echo "-- $r start black 2"
 470 if hg jcheck_test -R z -r tip; then true; else fail; fi
 471 r=$(expr $r + 1)
 472 
 473 echo "-- $r start black 3"
 474 echo foo2 >z/foo
 475 HGUSER=$setup_author hg ci -R z -m '2020202: Bad, before start, but black' -d '2017-08-30'
 476 if hg jcheck_test --black $startblack2hash -R z -r tip; then fail; fi
 477 r=$(expr $r + 1)
 478 
 479 echo "-- $r start black 4"
 480 if hg jcheck_test -R z -r tip; then true; else fail; fi
 481 r=$(expr $r + 1)
 482 
 483 echo "-- $r start white 1"
 484 echo foobar >z/foo
 485 HGUSER=$setup_author hg ci -R z -m '3030303: Bad, after start, but white' -d '2017-09-01'
 486 if hg jcheck_test --white $startwhitehash -R z -r tip; then true; else fail; fi
 487 r=$(expr $r + 1)
 488 
 489 echo "-- $r start white 2"
 490 if hg jcheck_test -R z -r tip; then fail; fi
 491 
 492 # Summary
 493 
 494 if [ $failures -gt 0 ]; then
 495   echo "-- FAILURES: $failures"
 496 else
 497   echo "-- All tests passed"
 498 fi
 499 [ $failures != 0 ] && exit 1 || exit 0
< prev index next >