Fossil SCM

If a test is skipped inside a file, now include in the summary from tester.tcl

danshearer 2026-11-17 13:15 UTC test-suite-new
Commit 7654c67631d7ce7947660a021301628d855446a73a2b4275a8f955db3d7be68a
+2 -1
--- test/README.md
+++ test/README.md
@@ -67,11 +67,12 @@
6767
6868
## Writing new tests
6969
7070
Each `NAME.test` file is a Tcl script sourced by `tester.tcl`. `test_setup` creates and opens a repository in a temporary directory. `fossil ARGS` runs the
7171
executable being tested and sets `RESULT` to its output and `CODE` to its exit status. `test_eq NAME ACTUAL EXPECTED` and `test_match NAME ACTUAL PATTERN`
72
-report both values when they fail, and `test NAME EXPRESSION` gives the report. `test_skip REASON` skips the rest of the file, and `test_fail_then_return NAME
72
+report both values when they fail, and `test NAME EXPRESSION` gives the report. `test_skip REASON` skips the rest of the file, `test_skip_part REASON`
73
+reports a few skipped tests while the file continues, and `test_fail_then_return NAME
7374
REASON` records a failed setup step and stops the file. A last argument of `knownBug` to any of the `test` procedures marks a known bug as described above.
7475
7576
## Maintaining the tests
7677
7778
First step is noticing bugs. One pattern is when Fossil's output changes causing tests that rely on changed output to fail. `tester.tcl` prints the expected and the actual text for each but this won't always be obvious. It's possible that output changes may mask a code failure too.
7879
--- test/README.md
+++ test/README.md
@@ -67,11 +67,12 @@
67
68 ## Writing new tests
69
70 Each `NAME.test` file is a Tcl script sourced by `tester.tcl`. `test_setup` creates and opens a repository in a temporary directory. `fossil ARGS` runs the
71 executable being tested and sets `RESULT` to its output and `CODE` to its exit status. `test_eq NAME ACTUAL EXPECTED` and `test_match NAME ACTUAL PATTERN`
72 report both values when they fail, and `test NAME EXPRESSION` gives the report. `test_skip REASON` skips the rest of the file, and `test_fail_then_return NAME
 
73 REASON` records a failed setup step and stops the file. A last argument of `knownBug` to any of the `test` procedures marks a known bug as described above.
74
75 ## Maintaining the tests
76
77 First step is noticing bugs. One pattern is when Fossil's output changes causing tests that rely on changed output to fail. `tester.tcl` prints the expected and the actual text for each but this won't always be obvious. It's possible that output changes may mask a code failure too.
78
--- test/README.md
+++ test/README.md
@@ -67,11 +67,12 @@
67
68 ## Writing new tests
69
70 Each `NAME.test` file is a Tcl script sourced by `tester.tcl`. `test_setup` creates and opens a repository in a temporary directory. `fossil ARGS` runs the
71 executable being tested and sets `RESULT` to its output and `CODE` to its exit status. `test_eq NAME ACTUAL EXPECTED` and `test_match NAME ACTUAL PATTERN`
72 report both values when they fail, and `test NAME EXPRESSION` gives the report. `test_skip REASON` skips the rest of the file, `test_skip_part REASON`
73 reports a few skipped tests while the file continues, and `test_fail_then_return NAME
74 REASON` records a failed setup step and stops the file. A last argument of `knownBug` to any of the `test` procedures marks a known bug as described above.
75
76 ## Maintaining the tests
77
78 First step is noticing bugs. One pattern is when Fossil's output changes causing tests that rely on changed output to fail. `tester.tcl` prints the expected and the actual text for each but this won't always be obvious. It's possible that output changes may mask a code failure too.
79
+10 -2
--- test/tester.tcl
+++ test/tester.tcl
@@ -436,15 +436,23 @@
436436
# Skip the rest of the current test file because of REASON, which the
437437
# final summary reports beside the file name. Call it from the top
438438
# level of a test file.
439439
#
440440
proc test_skip {reason} {
441
+ test_skip_part $reason
442
+ uplevel 1 [list test_cleanup]
443
+ return -code return
444
+}
445
+
446
+# Record that some tests of the current test file are skipped because
447
+# of REASON, which says which tests. The final summary reports REASON
448
+# beside the file name, and the test file continues.
449
+#
450
+proc test_skip_part {reason} {
441451
global skipped_tests testfile
442452
lappend skipped_tests [list $testfile $reason]
443453
protOut "SKIPPED $testfile: $reason" 1
444
- uplevel 1 [list test_cleanup]
445
- return -code return
446454
}
447455
448456
# Record test NAME as failed because of REASON, then stop the current
449457
# test file. Call it from the top level of a test file when a step
450458
# that the rest of the file depends on has failed.
451459
--- test/tester.tcl
+++ test/tester.tcl
@@ -436,15 +436,23 @@
436 # Skip the rest of the current test file because of REASON, which the
437 # final summary reports beside the file name. Call it from the top
438 # level of a test file.
439 #
440 proc test_skip {reason} {
 
 
 
 
 
 
 
 
 
 
441 global skipped_tests testfile
442 lappend skipped_tests [list $testfile $reason]
443 protOut "SKIPPED $testfile: $reason" 1
444 uplevel 1 [list test_cleanup]
445 return -code return
446 }
447
448 # Record test NAME as failed because of REASON, then stop the current
449 # test file. Call it from the top level of a test file when a step
450 # that the rest of the file depends on has failed.
451
--- test/tester.tcl
+++ test/tester.tcl
@@ -436,15 +436,23 @@
436 # Skip the rest of the current test file because of REASON, which the
437 # final summary reports beside the file name. Call it from the top
438 # level of a test file.
439 #
440 proc test_skip {reason} {
441 test_skip_part $reason
442 uplevel 1 [list test_cleanup]
443 return -code return
444 }
445
446 # Record that some tests of the current test file are skipped because
447 # of REASON, which says which tests. The final summary reports REASON
448 # beside the file name, and the test file continues.
449 #
450 proc test_skip_part {reason} {
451 global skipped_tests testfile
452 lappend skipped_tests [list $testfile $reason]
453 protOut "SKIPPED $testfile: $reason" 1
 
 
454 }
455
456 # Record test NAME as failed because of REASON, then stop the current
457 # test file. Call it from the top level of a test file when a step
458 # that the rest of the file depends on has failed.
459
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -68,11 +68,11 @@
6868
fossil test-th-render --open-config \
6969
[file nativename [file join $path th1-tcl2.txt]]
7070
7171
test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
7272
} else {
73
- puts stderr "Skipping 'th1-tcl-2', SQLite package for Tcl not available"
73
+ test_skip_part "th1-tcl-2: SQLite package for Tcl not available"
7474
}
7575
7676
###############################################################################
7777
7878
fossil test-th-render --open-config \
7979
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -68,11 +68,11 @@
68 fossil test-th-render --open-config \
69 [file nativename [file join $path th1-tcl2.txt]]
70
71 test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
72 } else {
73 puts stderr "Skipping 'th1-tcl-2', SQLite package for Tcl not available"
74 }
75
76 ###############################################################################
77
78 fossil test-th-render --open-config \
79
--- test/th1-tcl.test
+++ test/th1-tcl.test
@@ -68,11 +68,11 @@
68 fossil test-th-render --open-config \
69 [file nativename [file join $path th1-tcl2.txt]]
70
71 test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]}
72 } else {
73 test_skip_part "th1-tcl-2: SQLite package for Tcl not available"
74 }
75
76 ###############################################################################
77
78 fossil test-th-render --open-config \
79
+3 -2
--- test/th1.test
+++ test/th1.test
@@ -556,13 +556,14 @@
556556
557557
###############################################################################
558558
559559
set skip_anycap 1
560560
if {$::outside_fossil_repo} {
561
- puts "Skipping th1-anycap-*-1 perm tests: not in Fossil repo checkout."
561
+ test_skip_part "th1-anycap-*-1 perm tests: not in Fossil repo checkout."
562562
} elseif ($::dirty_ckout) {
563
- puts "Skipping th1-anycap-*-1 perm tests: uncommitted changes in Fossil checkout."
563
+ test_skip_part "th1-anycap-*-1 perm tests: uncommitted changes in\
564
+Fossil checkout."
564565
} else {
565566
set skip_anycap 0
566567
}
567568
568569
# NOTE: The 'd' permission is no longer used.
569570
--- test/th1.test
+++ test/th1.test
@@ -556,13 +556,14 @@
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 } elseif ($::dirty_ckout) {
563 puts "Skipping th1-anycap-*-1 perm tests: uncommitted changes in Fossil checkout."
 
564 } else {
565 set skip_anycap 0
566 }
567
568 # NOTE: The 'd' permission is no longer used.
569
--- test/th1.test
+++ test/th1.test
@@ -556,13 +556,14 @@
556
557 ###############################################################################
558
559 set skip_anycap 1
560 if {$::outside_fossil_repo} {
561 test_skip_part "th1-anycap-*-1 perm tests: not in Fossil repo checkout."
562 } elseif ($::dirty_ckout) {
563 test_skip_part "th1-anycap-*-1 perm tests: uncommitted changes in\
564 Fossil checkout."
565 } else {
566 set skip_anycap 0
567 }
568
569 # NOTE: The 'd' permission is no longer used.
570

Keyboard Shortcuts

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