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.

wyoung 2018-09-03 06:22 wrap-run_in_checkout
Commit 3cb1b4f0a4e1f8b880d6589007b7b4ff729b7d9a4ff072327c9c2cd54c4adb08
1 file changed +10 -1
+10 -1
--- test/th1.test
+++ test/th1.test
@@ -553,10 +553,17 @@
553553
554554
fossil test-th-eval "lindex list -0x"
555555
test th1-expr-49 {$RESULT eq {TH_ERROR: expected integer, got: "-0x"}}
556556
557557
###############################################################################
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
+}
558565
559566
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] {
560567
if {$perm eq "u"} continue; # NOTE: Skip "reader" meta-permission.
561568
if {$perm eq "v"} continue; # NOTE: Skip "developer" meta-permission.
562569
@@ -567,11 +574,13 @@
567574
test th1-hascap-no-$perm-1 {$RESULT eq {0}}
568575
569576
fossil test-th-eval "anoncap $perm"
570577
test th1-anoncap-no-$perm-1 {$RESULT eq {0}}
571578
572
- test_block_in_checkout "th1-anycap-*-1 perm" {
579
+ if {$skip_anycap} { continue }
580
+
581
+ run_in_checkout {
573582
fossil test-th-eval --set-user-caps "anycap $perm"
574583
test th1-anycap-yes-$perm-1 {$RESULT eq {1}}
575584
576585
set ::env(TH1_TEST_USER_CAPS) 1; # NOTE: Bad permission.
577586
fossil test-th-eval --set-user-caps "anycap $perm"
578587
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button