Fossil SCM
Wrap each .test file in a catch command, with output of the error messages to the log for sanity. This should reduce the ways that a failing test case can unexpectedly wedge the entire test suite.
Commit
cdf1700ade96d36686cb488ed45e9e053de90fdc2ea51d50ddf83e13f638c693
Parent
6167f69a218804b…
1 file changed
+13
-1
+13
-1
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -112,10 +112,18 @@ | ||
| 112 | 112 | fconfigure $out -translation platform |
| 113 | 113 | puts $out $msg |
| 114 | 114 | close $out |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | + | |
| 118 | +proc protOutDict {dict {pattern *}} { | |
| 119 | + set longest [tcl::mathfunc::max 0 {*}[lmap key [dict keys $dict $pattern] {string length $key}]] | |
| 120 | + dict for {key value} $dict { | |
| 121 | + protOut [format "%-${longest}s = %s" $key $value] | |
| 122 | + } | |
| 123 | +} | |
| 124 | + | |
| 117 | 125 | |
| 118 | 126 | # Run the Fossil program with the specified arguments. |
| 119 | 127 | # |
| 120 | 128 | # Consults the VERBOSE global variable to determine if |
| 121 | 129 | # diagnostics should be emitted when no error is seen. |
| @@ -959,16 +967,20 @@ | ||
| 959 | 967 | file mkdir $tempHomePath |
| 960 | 968 | } error] != 0} { |
| 961 | 969 | error "Could not make directory \"$tempHomePath\",\ |
| 962 | 970 | please set TEMP variable in environment, error: $error" |
| 963 | 971 | } |
| 972 | + | |
| 964 | 973 | |
| 965 | 974 | protInit $fossilexe |
| 966 | 975 | set ::tempKeepHome 1 |
| 967 | 976 | foreach testfile $argv { |
| 968 | 977 | protOut "***** $testfile ******" |
| 969 | - source $testdir/$testfile.test | |
| 978 | + if { [catch {source $testdir/$testfile.test} testerror testopts] } { | |
| 979 | + protOut "!!!!! $testfile: $testerror" | |
| 980 | + protOutDict $testopts" | |
| 981 | + } | |
| 970 | 982 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 971 | 983 | } |
| 972 | 984 | unset ::tempKeepHome; delete_temporary_home |
| 973 | 985 | set nErr [llength $bad_test] |
| 974 | 986 | if {$nErr>0 || !$::QUIET} { |
| 975 | 987 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -112,10 +112,18 @@ | |
| 112 | fconfigure $out -translation platform |
| 113 | puts $out $msg |
| 114 | close $out |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | # Run the Fossil program with the specified arguments. |
| 119 | # |
| 120 | # Consults the VERBOSE global variable to determine if |
| 121 | # diagnostics should be emitted when no error is seen. |
| @@ -959,16 +967,20 @@ | |
| 959 | file mkdir $tempHomePath |
| 960 | } error] != 0} { |
| 961 | error "Could not make directory \"$tempHomePath\",\ |
| 962 | please set TEMP variable in environment, error: $error" |
| 963 | } |
| 964 | |
| 965 | protInit $fossilexe |
| 966 | set ::tempKeepHome 1 |
| 967 | foreach testfile $argv { |
| 968 | protOut "***** $testfile ******" |
| 969 | source $testdir/$testfile.test |
| 970 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 971 | } |
| 972 | unset ::tempKeepHome; delete_temporary_home |
| 973 | set nErr [llength $bad_test] |
| 974 | if {$nErr>0 || !$::QUIET} { |
| 975 |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -112,10 +112,18 @@ | |
| 112 | fconfigure $out -translation platform |
| 113 | puts $out $msg |
| 114 | close $out |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | proc protOutDict {dict {pattern *}} { |
| 119 | set longest [tcl::mathfunc::max 0 {*}[lmap key [dict keys $dict $pattern] {string length $key}]] |
| 120 | dict for {key value} $dict { |
| 121 | protOut [format "%-${longest}s = %s" $key $value] |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | |
| 126 | # Run the Fossil program with the specified arguments. |
| 127 | # |
| 128 | # Consults the VERBOSE global variable to determine if |
| 129 | # diagnostics should be emitted when no error is seen. |
| @@ -959,16 +967,20 @@ | |
| 967 | file mkdir $tempHomePath |
| 968 | } error] != 0} { |
| 969 | error "Could not make directory \"$tempHomePath\",\ |
| 970 | please set TEMP variable in environment, error: $error" |
| 971 | } |
| 972 | |
| 973 | |
| 974 | protInit $fossilexe |
| 975 | set ::tempKeepHome 1 |
| 976 | foreach testfile $argv { |
| 977 | protOut "***** $testfile ******" |
| 978 | if { [catch {source $testdir/$testfile.test} testerror testopts] } { |
| 979 | protOut "!!!!! $testfile: $testerror" |
| 980 | protOutDict $testopts" |
| 981 | } |
| 982 | protOut "***** End of $testfile: [llength $bad_test] errors so far ******" |
| 983 | } |
| 984 | unset ::tempKeepHome; delete_temporary_home |
| 985 | set nErr [llength $bad_test] |
| 986 | if {$nErr>0 || !$::QUIET} { |
| 987 |