Fossil SCM
If a test is skipped inside a file, now include in the summary from tester.tcl
Commit
7654c67631d7ce7947660a021301628d855446a73a2b4275a8f955db3d7be68a
Parent
d5645b8c03a2ec7…
4 files changed
+2
-1
+10
-2
+1
-1
+3
-2
+2
-1
| --- test/README.md | ||
| +++ test/README.md | ||
| @@ -67,11 +67,12 @@ | ||
| 67 | 67 | |
| 68 | 68 | ## Writing new tests |
| 69 | 69 | |
| 70 | 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 | 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 | |
| 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 | |
| 73 | 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. |
| 74 | 75 | |
| 75 | 76 | ## Maintaining the tests |
| 76 | 77 | |
| 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. |
| 78 | 79 |
| --- 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 @@ | ||
| 436 | 436 | # Skip the rest of the current test file because of REASON, which the |
| 437 | 437 | # final summary reports beside the file name. Call it from the top |
| 438 | 438 | # level of a test file. |
| 439 | 439 | # |
| 440 | 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} { | |
| 441 | 451 | global skipped_tests testfile |
| 442 | 452 | lappend skipped_tests [list $testfile $reason] |
| 443 | 453 | protOut "SKIPPED $testfile: $reason" 1 |
| 444 | - uplevel 1 [list test_cleanup] | |
| 445 | - return -code return | |
| 446 | 454 | } |
| 447 | 455 | |
| 448 | 456 | # Record test NAME as failed because of REASON, then stop the current |
| 449 | 457 | # test file. Call it from the top level of a test file when a step |
| 450 | 458 | # that the rest of the file depends on has failed. |
| 451 | 459 |
| --- 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 |
+1
-1
| --- test/th1-tcl.test | ||
| +++ test/th1-tcl.test | ||
| @@ -68,11 +68,11 @@ | ||
| 68 | 68 | fossil test-th-render --open-config \ |
| 69 | 69 | [file nativename [file join $path th1-tcl2.txt]] |
| 70 | 70 | |
| 71 | 71 | test th1-tcl-2 {[regexp -- {^\d+$} [normalize_result]]} |
| 72 | 72 | } 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" | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | ############################################################################### |
| 77 | 77 | |
| 78 | 78 | fossil test-th-render --open-config \ |
| 79 | 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 | 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 @@ | ||
| 556 | 556 | |
| 557 | 557 | ############################################################################### |
| 558 | 558 | |
| 559 | 559 | set skip_anycap 1 |
| 560 | 560 | 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." | |
| 562 | 562 | } 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." | |
| 564 | 565 | } else { |
| 565 | 566 | set skip_anycap 0 |
| 566 | 567 | } |
| 567 | 568 | |
| 568 | 569 | # NOTE: The 'd' permission is no longer used. |
| 569 | 570 |
| --- 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 |