-# -*- coding: cp1251 -*-
# Установка номера тестового ПРА
namespace eval vizir {
}
set test_id [file rootname [file tail [info script]]]$suffix
set stat [open "stats" a]
- fconfigure $stat -encoding cp1251
+ fconfigure $stat -encoding utf-8
puts $stat [list $test_id [rus $t_name] $no $ok $failed $p_skip $c_skip]
close $stat
if {!$failed} {
if [info exists $file] {puts [test_log] "Deleting $file"
file delete $file}
}
- }
+ } {
+ # signal to a caller that we had failures
+ exit 1
+ }
}
#
# Вовзращает идентификатор канала, куда пишется лог тестов.
}
return 1
}
-# Перекодирует строку из кодировки скрипта (assumed 1251)
-# в текущую системную
-
-if {[encoding system] == "utf-8" } {
-
proc rus {string} {
- return [encoding convertfrom cp1251 $string]
-}
-
-} else {
-
-proc rus {string} "
- return \[encoding convertfrom cp1251 \[encoding convertto [encoding system] \$string\]\]
-"
-
+ return $string
}
#
# Пишет строку в лог
puts -nonewline [rus [format "Тест%5d: %-60s:" $no [string range $testname 0 59]]]
flush stdout
set curtest $testname
- log [rus "Тест $no: $testname start"]
+ log [rus "\n\nТест $no: $testname start"]
}
#
# Вызывается при пропуске теста