mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0031731: Draw Harness - colorize errors and exception messages
Draw_Interpretor, CommandCmd() - catched exceptions and messages put into Tcl string result before throwing a Tcl exception (return 1) are now print in intense red (using Message::SendFail()). Duplication of exception message in std::cout and Tcl output has been removed. Draw Harness plugins have been updated to use either Message::SendFail() or theDI instead of std::cout/std::cerr for printing colored error message before throwing a Tcl exception.
This commit is contained in:
@@ -1319,6 +1319,7 @@ proc _run_test {scriptsdir group gridname casefile echo} {
|
||||
|
||||
# evaluate test case
|
||||
set tmp_imagedir 0
|
||||
set anExcep ""
|
||||
if [catch {
|
||||
# set variables identifying test case
|
||||
uplevel set casename [file tail $casefile]
|
||||
@@ -1368,13 +1369,15 @@ proc _run_test {scriptsdir group gridname casefile echo} {
|
||||
uplevel source -encoding utf-8 $scriptsdir/$group/end
|
||||
}
|
||||
} res] {
|
||||
puts "Tcl Exception: $res"
|
||||
set anExcep $res
|
||||
if { "$res" == "" } { set anExcep "EMPTY" }
|
||||
}
|
||||
|
||||
# stop logging
|
||||
if { $dlog_exists } {
|
||||
if { $echo } {
|
||||
decho off
|
||||
if { "$anExcep" != "" } { dputs -red -intense "Tcl Exception: $res" }
|
||||
} else {
|
||||
rename puts {}
|
||||
rename puts-saved puts
|
||||
|
Reference in New Issue
Block a user