Fossil SCM
In the test summary, give a reason if a test file is skipped
Commit
202176237fbe08fe305b3689cb7af08085cca6a3e393dc95ac8cfbd445996e47
Parent
c2b55363da1cd69…
12 files changed
+4
-4
+5
-9
+2
-8
+1
-2
+2
-3
+2
-3
+3
-4
+22
-5
+2
-4
+1
-2
+1
-2
+3
-4
+4
-4
| --- test/amend.test | ||
| +++ test/amend.test | ||
| @@ -50,19 +50,19 @@ | ||
| 50 | 50 | ######################################## |
| 51 | 51 | # Setup: Add file and commit # |
| 52 | 52 | ######################################## |
| 53 | 53 | |
| 54 | 54 | if {![uuid_from_checkout HASHINIT]} { |
| 55 | - test amend-checkout-failure false | |
| 56 | - test_cleanup_then_return | |
| 55 | + test_fail_then_return amend-checkout-failure \ | |
| 56 | + "could not read the check-out's hash" | |
| 57 | 57 | } |
| 58 | 58 | write_file datafile "data" |
| 59 | 59 | fossil add datafile |
| 60 | 60 | fossil commit -m "c1" |
| 61 | 61 | if {![uuid_from_commit $RESULT HASH]} { |
| 62 | - test amend-setup-failure false | |
| 63 | - test_cleanup_then_return | |
| 62 | + test_fail_then_return amend-setup-failure \ | |
| 63 | + "could not read the hash of the first commit: $RESULT" | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | ######################################## |
| 67 | 67 | # Test: -branch # |
| 68 | 68 | ######################################## |
| 69 | 69 |
| --- test/amend.test | |
| +++ test/amend.test | |
| @@ -50,19 +50,19 @@ | |
| 50 | ######################################## |
| 51 | # Setup: Add file and commit # |
| 52 | ######################################## |
| 53 | |
| 54 | if {![uuid_from_checkout HASHINIT]} { |
| 55 | test amend-checkout-failure false |
| 56 | test_cleanup_then_return |
| 57 | } |
| 58 | write_file datafile "data" |
| 59 | fossil add datafile |
| 60 | fossil commit -m "c1" |
| 61 | if {![uuid_from_commit $RESULT HASH]} { |
| 62 | test amend-setup-failure false |
| 63 | test_cleanup_then_return |
| 64 | } |
| 65 | |
| 66 | ######################################## |
| 67 | # Test: -branch # |
| 68 | ######################################## |
| 69 |
| --- test/amend.test | |
| +++ test/amend.test | |
| @@ -50,19 +50,19 @@ | |
| 50 | ######################################## |
| 51 | # Setup: Add file and commit # |
| 52 | ######################################## |
| 53 | |
| 54 | if {![uuid_from_checkout HASHINIT]} { |
| 55 | test_fail_then_return amend-checkout-failure \ |
| 56 | "could not read the check-out's hash" |
| 57 | } |
| 58 | write_file datafile "data" |
| 59 | fossil add datafile |
| 60 | fossil commit -m "c1" |
| 61 | if {![uuid_from_commit $RESULT HASH]} { |
| 62 | test_fail_then_return amend-setup-failure \ |
| 63 | "could not read the hash of the first commit: $RESULT" |
| 64 | } |
| 65 | |
| 66 | ######################################## |
| 67 | # Test: -branch # |
| 68 | ######################################## |
| 69 |
+5
-9
| --- test/json.test | ||
| +++ test/json.test | ||
| @@ -24,25 +24,21 @@ | ||
| 24 | 24 | # not configured. If that changes, these conditions might not prevent |
| 25 | 25 | # the rest of this file from running. |
| 26 | 26 | fossil test-th-eval "hasfeature json" |
| 27 | 27 | |
| 28 | 28 | if {[normalize_result] ne "1"} { |
| 29 | - puts "Fossil was not compiled with JSON support." | |
| 30 | - test_cleanup_then_return | |
| 29 | + test_skip "Fossil was not compiled with JSON support." | |
| 31 | 30 | } |
| 32 | 31 | |
| 33 | 32 | # We need a JSON parser to effectively test the JSON produced by |
| 34 | 33 | # fossil. It looks like the one from tcllib is exactly what we need. |
| 35 | 34 | # On ActiveTcl, add it with teacup. On other platforms, YMMV. |
| 36 | 35 | # teacup install json |
| 37 | 36 | # teacup install json::write |
| 38 | 37 | if {[catch {package require json}] != 0} then { |
| 39 | - puts { | |
| 40 | -The "json" package for Tcl is not available. | |
| 41 | -Please see: https://core.tcl-lang.org/tcllib | |
| 42 | -} | |
| 43 | - test_cleanup_then_return | |
| 38 | + test_skip "The \"json\" package for Tcl is not available.\ | |
| 39 | +Please see: https://core.tcl-lang.org/tcllib" | |
| 44 | 40 | } |
| 45 | 41 | |
| 46 | 42 | proc json2dict {txt} { |
| 47 | 43 | set rc [catch {::json::json2dict $txt} result options] |
| 48 | 44 | if {$rc != 0} { |
| @@ -54,12 +50,12 @@ | ||
| 54 | 50 | |
| 55 | 51 | # and that the json itself smells ok and has the expected API error code in it |
| 56 | 52 | fossil json -expectError |
| 57 | 53 | set JR [json2dict $RESULT] |
| 58 | 54 | if {$JR eq ""} { |
| 59 | - puts "Fossil was not compiled with JSON support (bad JSON)." | |
| 60 | - test_cleanup_then_return | |
| 55 | + test_fail_then_return json-bad-output \ | |
| 56 | + "\"fossil json\" did not return valid JSON: $RESULT" | |
| 61 | 57 | } |
| 62 | 58 | test json-1 {[dict exists $JR resultCode] |
| 63 | 59 | && [dict get $JR resultCode] in "FOSSIL-3002 FOSSIL-4102"} |
| 64 | 60 | |
| 65 | 61 | # Use the CLI interface to execute a JSON command. Sets the global |
| 66 | 62 |
| --- test/json.test | |
| +++ test/json.test | |
| @@ -24,25 +24,21 @@ | |
| 24 | # not configured. If that changes, these conditions might not prevent |
| 25 | # the rest of this file from running. |
| 26 | fossil test-th-eval "hasfeature json" |
| 27 | |
| 28 | if {[normalize_result] ne "1"} { |
| 29 | puts "Fossil was not compiled with JSON support." |
| 30 | test_cleanup_then_return |
| 31 | } |
| 32 | |
| 33 | # We need a JSON parser to effectively test the JSON produced by |
| 34 | # fossil. It looks like the one from tcllib is exactly what we need. |
| 35 | # On ActiveTcl, add it with teacup. On other platforms, YMMV. |
| 36 | # teacup install json |
| 37 | # teacup install json::write |
| 38 | if {[catch {package require json}] != 0} then { |
| 39 | puts { |
| 40 | The "json" package for Tcl is not available. |
| 41 | Please see: https://core.tcl-lang.org/tcllib |
| 42 | } |
| 43 | test_cleanup_then_return |
| 44 | } |
| 45 | |
| 46 | proc json2dict {txt} { |
| 47 | set rc [catch {::json::json2dict $txt} result options] |
| 48 | if {$rc != 0} { |
| @@ -54,12 +50,12 @@ | |
| 54 | |
| 55 | # and that the json itself smells ok and has the expected API error code in it |
| 56 | fossil json -expectError |
| 57 | set JR [json2dict $RESULT] |
| 58 | if {$JR eq ""} { |
| 59 | puts "Fossil was not compiled with JSON support (bad JSON)." |
| 60 | test_cleanup_then_return |
| 61 | } |
| 62 | test json-1 {[dict exists $JR resultCode] |
| 63 | && [dict get $JR resultCode] in "FOSSIL-3002 FOSSIL-4102"} |
| 64 | |
| 65 | # Use the CLI interface to execute a JSON command. Sets the global |
| 66 |
| --- test/json.test | |
| +++ test/json.test | |
| @@ -24,25 +24,21 @@ | |
| 24 | # not configured. If that changes, these conditions might not prevent |
| 25 | # the rest of this file from running. |
| 26 | fossil test-th-eval "hasfeature json" |
| 27 | |
| 28 | if {[normalize_result] ne "1"} { |
| 29 | test_skip "Fossil was not compiled with JSON support." |
| 30 | } |
| 31 | |
| 32 | # We need a JSON parser to effectively test the JSON produced by |
| 33 | # fossil. It looks like the one from tcllib is exactly what we need. |
| 34 | # On ActiveTcl, add it with teacup. On other platforms, YMMV. |
| 35 | # teacup install json |
| 36 | # teacup install json::write |
| 37 | if {[catch {package require json}] != 0} then { |
| 38 | test_skip "The \"json\" package for Tcl is not available.\ |
| 39 | Please see: https://core.tcl-lang.org/tcllib" |
| 40 | } |
| 41 | |
| 42 | proc json2dict {txt} { |
| 43 | set rc [catch {::json::json2dict $txt} result options] |
| 44 | if {$rc != 0} { |
| @@ -54,12 +50,12 @@ | |
| 50 | |
| 51 | # and that the json itself smells ok and has the expected API error code in it |
| 52 | fossil json -expectError |
| 53 | set JR [json2dict $RESULT] |
| 54 | if {$JR eq ""} { |
| 55 | test_fail_then_return json-bad-output \ |
| 56 | "\"fossil json\" did not return valid JSON: $RESULT" |
| 57 | } |
| 58 | test json-1 {[dict exists $JR resultCode] |
| 59 | && [dict get $JR resultCode] in "FOSSIL-3002 FOSSIL-4102"} |
| 60 | |
| 61 | # Use the CLI interface to execute a JSON command. Sets the global |
| 62 |
+2
-8
| --- test/merge5.test | ||
| +++ test/merge5.test | ||
| @@ -16,19 +16,13 @@ | ||
| 16 | 16 | ############################################################################ |
| 17 | 17 | # |
| 18 | 18 | # Tests of the "merge" command |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | -if {! $::QUIET} { | |
| 22 | - puts "Skipping Merge5 tests" | |
| 23 | -} | |
| 24 | -protOut { | |
| 25 | -fossil sqlite3 --no-repository reacts badly to SQL dumped from | |
| 26 | -repositories created from fossil older than version 2.0. | |
| 27 | -} | |
| 28 | 21 | #test merge5-sqlite3-issue false knownBug |
| 29 | -test_cleanup_then_return | |
| 22 | +test_skip "fossil sqlite3 --no-repository reacts badly to SQL dumped from\ | |
| 23 | +repositories created from fossil older than version 2.0." | |
| 30 | 24 | |
| 31 | 25 | # Verify the results of a check-out |
| 32 | 26 | # |
| 33 | 27 | proc checkout-test {testid expected_content} { |
| 34 | 28 | set flist {} |
| 35 | 29 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -16,19 +16,13 @@ | |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # Tests of the "merge" command |
| 19 | # |
| 20 | |
| 21 | if {! $::QUIET} { |
| 22 | puts "Skipping Merge5 tests" |
| 23 | } |
| 24 | protOut { |
| 25 | fossil sqlite3 --no-repository reacts badly to SQL dumped from |
| 26 | repositories created from fossil older than version 2.0. |
| 27 | } |
| 28 | #test merge5-sqlite3-issue false knownBug |
| 29 | test_cleanup_then_return |
| 30 | |
| 31 | # Verify the results of a check-out |
| 32 | # |
| 33 | proc checkout-test {testid expected_content} { |
| 34 | set flist {} |
| 35 |
| --- test/merge5.test | |
| +++ test/merge5.test | |
| @@ -16,19 +16,13 @@ | |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # Tests of the "merge" command |
| 19 | # |
| 20 | |
| 21 | #test merge5-sqlite3-issue false knownBug |
| 22 | test_skip "fossil sqlite3 --no-repository reacts badly to SQL dumped from\ |
| 23 | repositories created from fossil older than version 2.0." |
| 24 | |
| 25 | # Verify the results of a check-out |
| 26 | # |
| 27 | proc checkout-test {testid expected_content} { |
| 28 | set flist {} |
| 29 |
+1
-2
| --- test/set-manifest.test | ||
| +++ test/set-manifest.test | ||
| @@ -34,12 +34,11 @@ | ||
| 34 | 34 | # We need SHA1 to effectively test the manifest files produced by |
| 35 | 35 | # fossil. It looks like the one from tcllib is exactly what we need. |
| 36 | 36 | # On ActiveTcl, add it with teacup. On other platforms, YMMV. |
| 37 | 37 | # teacup install sha1 |
| 38 | 38 | if {[catch {package require sha1}] != 0} { |
| 39 | - puts "The \"sha1\" package is not available." | |
| 40 | - test_cleanup_then_return | |
| 39 | + test_skip "The \"sha1\" package for Tcl is not available." | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | # We need a repository, so let it have one. |
| 44 | 43 | test_setup |
| 45 | 44 | |
| 46 | 45 |
| --- test/set-manifest.test | |
| +++ test/set-manifest.test | |
| @@ -34,12 +34,11 @@ | |
| 34 | # We need SHA1 to effectively test the manifest files produced by |
| 35 | # fossil. It looks like the one from tcllib is exactly what we need. |
| 36 | # On ActiveTcl, add it with teacup. On other platforms, YMMV. |
| 37 | # teacup install sha1 |
| 38 | if {[catch {package require sha1}] != 0} { |
| 39 | puts "The \"sha1\" package is not available." |
| 40 | test_cleanup_then_return |
| 41 | } |
| 42 | |
| 43 | # We need a repository, so let it have one. |
| 44 | test_setup |
| 45 | |
| 46 |
| --- test/set-manifest.test | |
| +++ test/set-manifest.test | |
| @@ -34,12 +34,11 @@ | |
| 34 | # We need SHA1 to effectively test the manifest files produced by |
| 35 | # fossil. It looks like the one from tcllib is exactly what we need. |
| 36 | # On ActiveTcl, add it with teacup. On other platforms, YMMV. |
| 37 | # teacup install sha1 |
| 38 | if {[catch {package require sha1}] != 0} { |
| 39 | test_skip "The \"sha1\" package for Tcl is not available." |
| 40 | } |
| 41 | |
| 42 | # We need a repository, so let it have one. |
| 43 | test_setup |
| 44 | |
| 45 |
+2
-3
| --- test/settings-repo.test | ||
| +++ test/settings-repo.test | ||
| @@ -19,13 +19,12 @@ | ||
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | set path [file dirname [info script]] |
| 22 | 22 | |
| 23 | 23 | if {![file isdirectory [get_source_dir]]} { |
| 24 | - puts "The source directory [get_source_dir], which defines the settings\ | |
| 25 | -to test, is not present." | |
| 26 | - test_cleanup_then_return | |
| 24 | + test_skip "The source directory [get_source_dir], which defines the\ | |
| 25 | +settings to test, is not present." | |
| 27 | 26 | } |
| 28 | 27 | |
| 29 | 28 | require_no_open_checkout |
| 30 | 29 | |
| 31 | 30 | test_setup |
| 32 | 31 |
| --- test/settings-repo.test | |
| +++ test/settings-repo.test | |
| @@ -19,13 +19,12 @@ | |
| 19 | # |
| 20 | |
| 21 | set path [file dirname [info script]] |
| 22 | |
| 23 | if {![file isdirectory [get_source_dir]]} { |
| 24 | puts "The source directory [get_source_dir], which defines the settings\ |
| 25 | to test, is not present." |
| 26 | test_cleanup_then_return |
| 27 | } |
| 28 | |
| 29 | require_no_open_checkout |
| 30 | |
| 31 | test_setup |
| 32 |
| --- test/settings-repo.test | |
| +++ test/settings-repo.test | |
| @@ -19,13 +19,12 @@ | |
| 19 | # |
| 20 | |
| 21 | set path [file dirname [info script]] |
| 22 | |
| 23 | if {![file isdirectory [get_source_dir]]} { |
| 24 | test_skip "The source directory [get_source_dir], which defines the\ |
| 25 | settings to test, is not present." |
| 26 | } |
| 27 | |
| 28 | require_no_open_checkout |
| 29 | |
| 30 | test_setup |
| 31 |
+2
-3
| --- test/settings.test | ||
| +++ test/settings.test | ||
| @@ -19,13 +19,12 @@ | ||
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | set path [file dirname [info script]] |
| 22 | 22 | |
| 23 | 23 | if {![file isdirectory [get_source_dir]]} { |
| 24 | - puts "The source directory [get_source_dir], which defines the settings\ | |
| 25 | -to test, is not present." | |
| 26 | - test_cleanup_then_return | |
| 24 | + test_skip "The source directory [get_source_dir], which defines the\ | |
| 25 | +settings to test, is not present." | |
| 27 | 26 | } |
| 28 | 27 | |
| 29 | 28 | test_setup |
| 30 | 29 | |
| 31 | 30 | ############################################################################### |
| 32 | 31 |
| --- test/settings.test | |
| +++ test/settings.test | |
| @@ -19,13 +19,12 @@ | |
| 19 | # |
| 20 | |
| 21 | set path [file dirname [info script]] |
| 22 | |
| 23 | if {![file isdirectory [get_source_dir]]} { |
| 24 | puts "The source directory [get_source_dir], which defines the settings\ |
| 25 | to test, is not present." |
| 26 | test_cleanup_then_return |
| 27 | } |
| 28 | |
| 29 | test_setup |
| 30 | |
| 31 | ############################################################################### |
| 32 |
| --- test/settings.test | |
| +++ test/settings.test | |
| @@ -19,13 +19,12 @@ | |
| 19 | # |
| 20 | |
| 21 | set path [file dirname [info script]] |
| 22 | |
| 23 | if {![file isdirectory [get_source_dir]]} { |
| 24 | test_skip "The source directory [get_source_dir], which defines the\ |
| 25 | settings to test, is not present." |
| 26 | } |
| 27 | |
| 28 | test_setup |
| 29 | |
| 30 | ############################################################################### |
| 31 |
+3
-4
| --- test/symlinks.test | ||
| +++ test/symlinks.test | ||
| @@ -19,12 +19,11 @@ | ||
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | set path [file dirname [info script]] |
| 22 | 22 | |
| 23 | 23 | if {$is_windows} { |
| 24 | - puts "Symlinks are not supported on Windows." | |
| 25 | - test_cleanup_then_return | |
| 24 | + test_skip "Symlinks are not supported on Windows." | |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | 27 | require_no_open_checkout |
| 29 | 28 | |
| 30 | 29 | ############################################################################### |
| @@ -36,12 +35,12 @@ | ||
| 36 | 35 | |
| 37 | 36 | fossil test-th-eval --open-config {repository} |
| 38 | 37 | set repository [normalize_result] |
| 39 | 38 | |
| 40 | 39 | if {[string length $repository] == 0} { |
| 41 | - puts "Detection of the open repository file failed." | |
| 42 | - test_cleanup_then_return | |
| 40 | + test_fail_then_return symlinks-repository \ | |
| 41 | + "Detection of the open repository file failed." | |
| 43 | 42 | } |
| 44 | 43 | |
| 45 | 44 | ####################################### |
| 46 | 45 | # Use symbolic link to a directory... # |
| 47 | 46 | ####################################### |
| 48 | 47 |
| --- test/symlinks.test | |
| +++ test/symlinks.test | |
| @@ -19,12 +19,11 @@ | |
| 19 | # |
| 20 | |
| 21 | set path [file dirname [info script]] |
| 22 | |
| 23 | if {$is_windows} { |
| 24 | puts "Symlinks are not supported on Windows." |
| 25 | test_cleanup_then_return |
| 26 | } |
| 27 | |
| 28 | require_no_open_checkout |
| 29 | |
| 30 | ############################################################################### |
| @@ -36,12 +35,12 @@ | |
| 36 | |
| 37 | fossil test-th-eval --open-config {repository} |
| 38 | set repository [normalize_result] |
| 39 | |
| 40 | if {[string length $repository] == 0} { |
| 41 | puts "Detection of the open repository file failed." |
| 42 | test_cleanup_then_return |
| 43 | } |
| 44 | |
| 45 | ####################################### |
| 46 | # Use symbolic link to a directory... # |
| 47 | ####################################### |
| 48 |
| --- test/symlinks.test | |
| +++ test/symlinks.test | |
| @@ -19,12 +19,11 @@ | |
| 19 | # |
| 20 | |
| 21 | set path [file dirname [info script]] |
| 22 | |
| 23 | if {$is_windows} { |
| 24 | test_skip "Symlinks are not supported on Windows." |
| 25 | } |
| 26 | |
| 27 | require_no_open_checkout |
| 28 | |
| 29 | ############################################################################### |
| @@ -36,12 +35,12 @@ | |
| 35 | |
| 36 | fossil test-th-eval --open-config {repository} |
| 37 | set repository [normalize_result] |
| 38 | |
| 39 | if {[string length $repository] == 0} { |
| 40 | test_fail_then_return symlinks-repository \ |
| 41 | "Detection of the open repository file failed." |
| 42 | } |
| 43 | |
| 44 | ####################################### |
| 45 | # Use symbolic link to a directory... # |
| 46 | ####################################### |
| 47 |
+22
-5
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -377,12 +377,10 @@ | ||
| 377 | 377 | $::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} { |
| 378 | 378 | return |
| 379 | 379 | } |
| 380 | 380 | catch {exec $::fossilexe info} res |
| 381 | 381 | if {[regexp {local-root:} $res]} { |
| 382 | - global skipped_tests testfile | |
| 383 | - lappend skipped_tests $testfile | |
| 384 | 382 | set projectName <unknown> |
| 385 | 383 | set localRoot <unknown> |
| 386 | 384 | regexp -line -- {^project-name: (.*)$} $res dummy projectName |
| 387 | 385 | set projectName [string trim $projectName] |
| 388 | 386 | regexp -line -- {^local-root: (.*)$} $res dummy localRoot |
| @@ -415,13 +413,29 @@ | ||
| 415 | 413 | after [expr {$try * 100}] |
| 416 | 414 | } |
| 417 | 415 | error "Could not delete \"$path\", error: $error" |
| 418 | 416 | } |
| 419 | 417 | |
| 420 | -proc test_cleanup_then_return {} { | |
| 418 | +# Skip the rest of the current test file because of REASON, which the | |
| 419 | +# final summary reports beside the file name. Call it from the top | |
| 420 | +# level of a test file. | |
| 421 | +# | |
| 422 | +proc test_skip {reason} { | |
| 421 | 423 | global skipped_tests testfile |
| 422 | - lappend skipped_tests $testfile | |
| 424 | + lappend skipped_tests [list $testfile $reason] | |
| 425 | + protOut "SKIPPED $testfile: $reason" 1 | |
| 426 | + uplevel 1 [list test_cleanup] | |
| 427 | + return -code return | |
| 428 | +} | |
| 429 | + | |
| 430 | +# Record test NAME as failed because of REASON, then stop the current | |
| 431 | +# test file. Call it from the top level of a test file when a step | |
| 432 | +# that the rest of the file depends on has failed. | |
| 433 | +# | |
| 434 | +proc test_fail_then_return {name reason} { | |
| 435 | + test $name 0 | |
| 436 | + protOut "$name: $reason" 1 | |
| 423 | 437 | uplevel 1 [list test_cleanup] |
| 424 | 438 | return -code return |
| 425 | 439 | } |
| 426 | 440 | |
| 427 | 441 | proc test_cleanup {} { |
| @@ -1082,10 +1096,13 @@ | ||
| 1082 | 1096 | if {$nErr>0} { |
| 1083 | 1097 | protOut "***** Ignored failures: $ignored_test" 1 |
| 1084 | 1098 | } |
| 1085 | 1099 | set nSkipped [llength $skipped_tests] |
| 1086 | 1100 | if {$nSkipped>0} { |
| 1087 | - protOut "***** Skipped tests: $skipped_tests" 1 | |
| 1101 | + protOut "***** Skipped tests: [lmap s $skipped_tests {lindex $s 0}]" 1 | |
| 1102 | + foreach s $skipped_tests { | |
| 1103 | + protOut "***** [lindex $s 0]: [lindex $s 1]" 1 | |
| 1104 | + } | |
| 1088 | 1105 | } |
| 1089 | 1106 | if {$bad_test>0} { |
| 1090 | 1107 | exit 1 |
| 1091 | 1108 | } |
| 1092 | 1109 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -377,12 +377,10 @@ | |
| 377 | $::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} { |
| 378 | return |
| 379 | } |
| 380 | catch {exec $::fossilexe info} res |
| 381 | if {[regexp {local-root:} $res]} { |
| 382 | global skipped_tests testfile |
| 383 | lappend skipped_tests $testfile |
| 384 | set projectName <unknown> |
| 385 | set localRoot <unknown> |
| 386 | regexp -line -- {^project-name: (.*)$} $res dummy projectName |
| 387 | set projectName [string trim $projectName] |
| 388 | regexp -line -- {^local-root: (.*)$} $res dummy localRoot |
| @@ -415,13 +413,29 @@ | |
| 415 | after [expr {$try * 100}] |
| 416 | } |
| 417 | error "Could not delete \"$path\", error: $error" |
| 418 | } |
| 419 | |
| 420 | proc test_cleanup_then_return {} { |
| 421 | global skipped_tests testfile |
| 422 | lappend skipped_tests $testfile |
| 423 | uplevel 1 [list test_cleanup] |
| 424 | return -code return |
| 425 | } |
| 426 | |
| 427 | proc test_cleanup {} { |
| @@ -1082,10 +1096,13 @@ | |
| 1082 | if {$nErr>0} { |
| 1083 | protOut "***** Ignored failures: $ignored_test" 1 |
| 1084 | } |
| 1085 | set nSkipped [llength $skipped_tests] |
| 1086 | if {$nSkipped>0} { |
| 1087 | protOut "***** Skipped tests: $skipped_tests" 1 |
| 1088 | } |
| 1089 | if {$bad_test>0} { |
| 1090 | exit 1 |
| 1091 | } |
| 1092 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -377,12 +377,10 @@ | |
| 377 | $::env(FOSSIL_TEST_DANGEROUS_IGNORE_OPEN_CHECKOUT) eq "YES_DO_IT"} { |
| 378 | return |
| 379 | } |
| 380 | catch {exec $::fossilexe info} res |
| 381 | if {[regexp {local-root:} $res]} { |
| 382 | set projectName <unknown> |
| 383 | set localRoot <unknown> |
| 384 | regexp -line -- {^project-name: (.*)$} $res dummy projectName |
| 385 | set projectName [string trim $projectName] |
| 386 | regexp -line -- {^local-root: (.*)$} $res dummy localRoot |
| @@ -415,13 +413,29 @@ | |
| 413 | after [expr {$try * 100}] |
| 414 | } |
| 415 | error "Could not delete \"$path\", error: $error" |
| 416 | } |
| 417 | |
| 418 | # Skip the rest of the current test file because of REASON, which the |
| 419 | # final summary reports beside the file name. Call it from the top |
| 420 | # level of a test file. |
| 421 | # |
| 422 | proc test_skip {reason} { |
| 423 | global skipped_tests testfile |
| 424 | lappend skipped_tests [list $testfile $reason] |
| 425 | protOut "SKIPPED $testfile: $reason" 1 |
| 426 | uplevel 1 [list test_cleanup] |
| 427 | return -code return |
| 428 | } |
| 429 | |
| 430 | # Record test NAME as failed because of REASON, then stop the current |
| 431 | # test file. Call it from the top level of a test file when a step |
| 432 | # that the rest of the file depends on has failed. |
| 433 | # |
| 434 | proc test_fail_then_return {name reason} { |
| 435 | test $name 0 |
| 436 | protOut "$name: $reason" 1 |
| 437 | uplevel 1 [list test_cleanup] |
| 438 | return -code return |
| 439 | } |
| 440 | |
| 441 | proc test_cleanup {} { |
| @@ -1082,10 +1096,13 @@ | |
| 1096 | if {$nErr>0} { |
| 1097 | protOut "***** Ignored failures: $ignored_test" 1 |
| 1098 | } |
| 1099 | set nSkipped [llength $skipped_tests] |
| 1100 | if {$nSkipped>0} { |
| 1101 | protOut "***** Skipped tests: [lmap s $skipped_tests {lindex $s 0}]" 1 |
| 1102 | foreach s $skipped_tests { |
| 1103 | protOut "***** [lindex $s 0]: [lindex $s 1]" 1 |
| 1104 | } |
| 1105 | } |
| 1106 | if {$bad_test>0} { |
| 1107 | exit 1 |
| 1108 | } |
| 1109 |
+2
-4
| --- test/th1-docs.test | ||
| +++ test/th1-docs.test | ||
| @@ -19,19 +19,17 @@ | ||
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | fossil test-th-eval "hasfeature th1Docs" |
| 22 | 22 | |
| 23 | 23 | if {[normalize_result] ne "1"} { |
| 24 | - puts "Fossil was not compiled with TH1 docs support." | |
| 25 | - test_cleanup_then_return | |
| 24 | + test_skip "Fossil was not compiled with TH1 docs support." | |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | 27 | fossil test-th-eval "hasfeature tcl" |
| 29 | 28 | |
| 30 | 29 | if {[normalize_result] ne "1"} { |
| 31 | - puts "Fossil was not compiled with Tcl support." | |
| 32 | - test_cleanup_then_return | |
| 30 | + test_skip "Fossil was not compiled with Tcl support." | |
| 33 | 31 | } |
| 34 | 32 | |
| 35 | 33 | ############################################################################### |
| 36 | 34 | |
| 37 | 35 | test_setup |
| 38 | 36 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -19,19 +19,17 @@ | |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval "hasfeature th1Docs" |
| 22 | |
| 23 | if {[normalize_result] ne "1"} { |
| 24 | puts "Fossil was not compiled with TH1 docs support." |
| 25 | test_cleanup_then_return |
| 26 | } |
| 27 | |
| 28 | fossil test-th-eval "hasfeature tcl" |
| 29 | |
| 30 | if {[normalize_result] ne "1"} { |
| 31 | puts "Fossil was not compiled with Tcl support." |
| 32 | test_cleanup_then_return |
| 33 | } |
| 34 | |
| 35 | ############################################################################### |
| 36 | |
| 37 | test_setup |
| 38 |
| --- test/th1-docs.test | |
| +++ test/th1-docs.test | |
| @@ -19,19 +19,17 @@ | |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval "hasfeature th1Docs" |
| 22 | |
| 23 | if {[normalize_result] ne "1"} { |
| 24 | test_skip "Fossil was not compiled with TH1 docs support." |
| 25 | } |
| 26 | |
| 27 | fossil test-th-eval "hasfeature tcl" |
| 28 | |
| 29 | if {[normalize_result] ne "1"} { |
| 30 | test_skip "Fossil was not compiled with Tcl support." |
| 31 | } |
| 32 | |
| 33 | ############################################################################### |
| 34 | |
| 35 | test_setup |
| 36 |
+1
-2
| --- test/th1-hooks.test | ||
| +++ test/th1-hooks.test | ||
| @@ -19,12 +19,11 @@ | ||
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | fossil test-th-eval "hasfeature th1Hooks" |
| 22 | 22 | |
| 23 | 23 | if {[normalize_result] ne "1"} { |
| 24 | - puts "Fossil was not compiled with TH1 hooks support." | |
| 25 | - test_cleanup_then_return | |
| 24 | + test_skip "Fossil was not compiled with TH1 hooks support." | |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | 27 | ############################################################################### |
| 29 | 28 | |
| 30 | 29 | test_setup |
| 31 | 30 |
| --- test/th1-hooks.test | |
| +++ test/th1-hooks.test | |
| @@ -19,12 +19,11 @@ | |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval "hasfeature th1Hooks" |
| 22 | |
| 23 | if {[normalize_result] ne "1"} { |
| 24 | puts "Fossil was not compiled with TH1 hooks support." |
| 25 | test_cleanup_then_return |
| 26 | } |
| 27 | |
| 28 | ############################################################################### |
| 29 | |
| 30 | test_setup |
| 31 |
| --- test/th1-hooks.test | |
| +++ test/th1-hooks.test | |
| @@ -19,12 +19,11 @@ | |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval "hasfeature th1Hooks" |
| 22 | |
| 23 | if {[normalize_result] ne "1"} { |
| 24 | test_skip "Fossil was not compiled with TH1 hooks support." |
| 25 | } |
| 26 | |
| 27 | ############################################################################### |
| 28 | |
| 29 | test_setup |
| 30 |
+1
-2
| --- test/th1-tcl.test | ||
| +++ test/th1-tcl.test | ||
| @@ -23,12 +23,11 @@ | ||
| 23 | 23 | ############################################################################### |
| 24 | 24 | |
| 25 | 25 | fossil test-th-eval "hasfeature tcl" |
| 26 | 26 | |
| 27 | 27 | if {[normalize_result] ne "1"} { |
| 28 | - puts "Fossil was not compiled with Tcl support." | |
| 29 | - test_cleanup_then_return | |
| 28 | + test_skip "Fossil was not compiled with Tcl support." | |
| 30 | 29 | } |
| 31 | 30 | |
| 32 | 31 | ############################################################################### |
| 33 | 32 | |
| 34 | 33 | test_setup |
| 35 | 34 |
| --- test/th1-tcl.test | |
| +++ test/th1-tcl.test | |
| @@ -23,12 +23,11 @@ | |
| 23 | ############################################################################### |
| 24 | |
| 25 | fossil test-th-eval "hasfeature tcl" |
| 26 | |
| 27 | if {[normalize_result] ne "1"} { |
| 28 | puts "Fossil was not compiled with Tcl support." |
| 29 | test_cleanup_then_return |
| 30 | } |
| 31 | |
| 32 | ############################################################################### |
| 33 | |
| 34 | test_setup |
| 35 |
| --- test/th1-tcl.test | |
| +++ test/th1-tcl.test | |
| @@ -23,12 +23,11 @@ | |
| 23 | ############################################################################### |
| 24 | |
| 25 | fossil test-th-eval "hasfeature tcl" |
| 26 | |
| 27 | if {[normalize_result] ne "1"} { |
| 28 | test_skip "Fossil was not compiled with Tcl support." |
| 29 | } |
| 30 | |
| 31 | ############################################################################### |
| 32 | |
| 33 | test_setup |
| 34 |
+3
-4
| --- test/unversioned.test | ||
| +++ test/unversioned.test | ||
| @@ -19,12 +19,11 @@ | ||
| 19 | 19 | # |
| 20 | 20 | |
| 21 | 21 | set path [file dirname [info script]] |
| 22 | 22 | |
| 23 | 23 | if {[catch {package require sha1}] != 0} { |
| 24 | - puts "The \"sha1\" package is not available." | |
| 25 | - test_cleanup_then_return | |
| 24 | + test_skip "The \"sha1\" package for Tcl is not available." | |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | 27 | require_no_open_checkout |
| 29 | 28 | |
| 30 | 29 | test_setup; set rootDir [file normalize [pwd]] |
| @@ -34,12 +33,12 @@ | ||
| 34 | 33 | |
| 35 | 34 | fossil test-th-eval --open-config {repository} |
| 36 | 35 | set repository [normalize_result] |
| 37 | 36 | |
| 38 | 37 | if {[string length $repository] == 0} { |
| 39 | - puts "Detection of the open repository file failed." | |
| 40 | - test_cleanup_then_return | |
| 38 | + test_fail_then_return unversioned-repository \ | |
| 39 | + "Detection of the open repository file failed." | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | write_file unversioned1.txt "This is unversioned file #1." |
| 44 | 43 | write_file unversioned2.txt " This is unversioned file #2. " |
| 45 | 44 | write_file "unversioned space.txt" "\nThis is unversioned file #3.\n" |
| 46 | 45 |
| --- test/unversioned.test | |
| +++ test/unversioned.test | |
| @@ -19,12 +19,11 @@ | |
| 19 | # |
| 20 | |
| 21 | set path [file dirname [info script]] |
| 22 | |
| 23 | if {[catch {package require sha1}] != 0} { |
| 24 | puts "The \"sha1\" package is not available." |
| 25 | test_cleanup_then_return |
| 26 | } |
| 27 | |
| 28 | require_no_open_checkout |
| 29 | |
| 30 | test_setup; set rootDir [file normalize [pwd]] |
| @@ -34,12 +33,12 @@ | |
| 34 | |
| 35 | fossil test-th-eval --open-config {repository} |
| 36 | set repository [normalize_result] |
| 37 | |
| 38 | if {[string length $repository] == 0} { |
| 39 | puts "Detection of the open repository file failed." |
| 40 | test_cleanup_then_return |
| 41 | } |
| 42 | |
| 43 | write_file unversioned1.txt "This is unversioned file #1." |
| 44 | write_file unversioned2.txt " This is unversioned file #2. " |
| 45 | write_file "unversioned space.txt" "\nThis is unversioned file #3.\n" |
| 46 |
| --- test/unversioned.test | |
| +++ test/unversioned.test | |
| @@ -19,12 +19,11 @@ | |
| 19 | # |
| 20 | |
| 21 | set path [file dirname [info script]] |
| 22 | |
| 23 | if {[catch {package require sha1}] != 0} { |
| 24 | test_skip "The \"sha1\" package for Tcl is not available." |
| 25 | } |
| 26 | |
| 27 | require_no_open_checkout |
| 28 | |
| 29 | test_setup; set rootDir [file normalize [pwd]] |
| @@ -34,12 +33,12 @@ | |
| 33 | |
| 34 | fossil test-th-eval --open-config {repository} |
| 35 | set repository [normalize_result] |
| 36 | |
| 37 | if {[string length $repository] == 0} { |
| 38 | test_fail_then_return unversioned-repository \ |
| 39 | "Detection of the open repository file failed." |
| 40 | } |
| 41 | |
| 42 | write_file unversioned1.txt "This is unversioned file #1." |
| 43 | write_file unversioned2.txt " This is unversioned file #2. " |
| 44 | write_file "unversioned space.txt" "\nThis is unversioned file #3.\n" |
| 45 |