Fossil SCM
Partially reverted one of the run_in_checkout replacements in test/th1.test: it was inside a foreach loop, which means the test for whether we're inside the Fossil repo checkout was being done 26 times. This is not only inefficient, it spammed the output with "Skipping test blabla..." lines. Now doing a manual check outside the loop and skipping the in-repo tests silently inside the loop.
Commit
3cb1b4f0a4e1f8b880d6589007b7b4ff729b7d9a4ff072327c9c2cd54c4adb08
Parent
4315d4646280b86…
1 file changed
+10
-1
+10
-1
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -553,10 +553,17 @@ | ||
| 553 | 553 | |
| 554 | 554 | fossil test-th-eval "lindex list -0x" |
| 555 | 555 | test th1-expr-49 {$RESULT eq {TH_ERROR: expected integer, got: "-0x"}} |
| 556 | 556 | |
| 557 | 557 | ############################################################################### |
| 558 | + | |
| 559 | +set skip_anycap 1 | |
| 560 | +if {$::outside_fossil_repo} { | |
| 561 | + puts "Skipping th1-anycap-*-1 perm tests: not in Fossil repo checkout." | |
| 562 | +} else { | |
| 563 | + set skip_anycap 0 | |
| 564 | +} | |
| 558 | 565 | |
| 559 | 566 | foreach perm [list a b c d e f g h i j k l m n o p q r s t u v w x y z] { |
| 560 | 567 | if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission. |
| 561 | 568 | if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission. |
| 562 | 569 | |
| @@ -567,11 +574,13 @@ | ||
| 567 | 574 | test th1-hascap-no-$perm-1 {$RESULT eq {0}} |
| 568 | 575 | |
| 569 | 576 | fossil test-th-eval "anoncap $perm" |
| 570 | 577 | test th1-anoncap-no-$perm-1 {$RESULT eq {0}} |
| 571 | 578 | |
| 572 | - test_block_in_checkout "th1-anycap-*-1 perm" { | |
| 579 | + if {$skip_anycap} { continue } | |
| 580 | + | |
| 581 | + run_in_checkout { | |
| 573 | 582 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 574 | 583 | test th1-anycap-yes-$perm-1 {$RESULT eq {1}} |
| 575 | 584 | |
| 576 | 585 | set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission. |
| 577 | 586 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 578 | 587 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -553,10 +553,17 @@ | |
| 553 | |
| 554 | fossil test-th-eval "lindex list -0x" |
| 555 | test th1-expr-49 {$RESULT eq {TH_ERROR: expected integer, got: "-0x"}} |
| 556 | |
| 557 | ############################################################################### |
| 558 | |
| 559 | foreach perm [list a b c d e f g h i j k l m n o p q r s t u v w x y z] { |
| 560 | if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission. |
| 561 | if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission. |
| 562 | |
| @@ -567,11 +574,13 @@ | |
| 567 | test th1-hascap-no-$perm-1 {$RESULT eq {0}} |
| 568 | |
| 569 | fossil test-th-eval "anoncap $perm" |
| 570 | test th1-anoncap-no-$perm-1 {$RESULT eq {0}} |
| 571 | |
| 572 | test_block_in_checkout "th1-anycap-*-1 perm" { |
| 573 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 574 | test th1-anycap-yes-$perm-1 {$RESULT eq {1}} |
| 575 | |
| 576 | set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission. |
| 577 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 578 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -553,10 +553,17 @@ | |
| 553 | |
| 554 | fossil test-th-eval "lindex list -0x" |
| 555 | test th1-expr-49 {$RESULT eq {TH_ERROR: expected integer, got: "-0x"}} |
| 556 | |
| 557 | ############################################################################### |
| 558 | |
| 559 | set skip_anycap 1 |
| 560 | if {$::outside_fossil_repo} { |
| 561 | puts "Skipping th1-anycap-*-1 perm tests: not in Fossil repo checkout." |
| 562 | } else { |
| 563 | set skip_anycap 0 |
| 564 | } |
| 565 | |
| 566 | foreach perm [list a b c d e f g h i j k l m n o p q r s t u v w x y z] { |
| 567 | if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission. |
| 568 | if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission. |
| 569 | |
| @@ -567,11 +574,13 @@ | |
| 574 | test th1-hascap-no-$perm-1 {$RESULT eq {0}} |
| 575 | |
| 576 | fossil test-th-eval "anoncap $perm" |
| 577 | test th1-anoncap-no-$perm-1 {$RESULT eq {0}} |
| 578 | |
| 579 | if {$skip_anycap} { continue } |
| 580 | |
| 581 | run_in_checkout { |
| 582 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 583 | test th1-anycap-yes-$perm-1 {$RESULT eq {1}} |
| 584 | |
| 585 | set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission. |
| 586 | fossil test-th-eval --set-user-caps "anycap $perm" |
| 587 |