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.

rberteig 2017-03-16 00:35 trunk
Commit cdf1700ade96d36686cb488ed45e9e053de90fdc2ea51d50ddf83e13f638c693
1 file changed +13 -1
+13 -1
--- test/tester.tcl
+++ test/tester.tcl
@@ -112,10 +112,18 @@
112112
fconfigure $out -translation platform
113113
puts $out $msg
114114
close $out
115115
}
116116
}
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
+
117125
118126
# Run the Fossil program with the specified arguments.
119127
#
120128
# Consults the VERBOSE global variable to determine if
121129
# diagnostics should be emitted when no error is seen.
@@ -959,16 +967,20 @@
959967
file mkdir $tempHomePath
960968
} error] != 0} {
961969
error "Could not make directory \"$tempHomePath\",\
962970
please set TEMP variable in environment, error: $error"
963971
}
972
+
964973
965974
protInit $fossilexe
966975
set ::tempKeepHome 1
967976
foreach testfile $argv {
968977
protOut "***** $testfile ******"
969
- source $testdir/$testfile.test
978
+ if { [catch {source $testdir/$testfile.test} testerror testopts] } {
979
+ protOut "!!!!! $testfile: $testerror"
980
+ protOutDict $testopts"
981
+ }
970982
protOut "***** End of $testfile: [llength $bad_test] errors so far ******"
971983
}
972984
unset ::tempKeepHome; delete_temporary_home
973985
set nErr [llength $bad_test]
974986
if {$nErr>0 || !$::QUIET} {
975987
--- 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

Keyboard Shortcuts

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