"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/support/test.tcl" between
redis-6.0.7.tar.gz and redis-6.0.8.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

test.tcl  (redis-6.0.7):test.tcl  (redis-6.0.8)
set ::num_tests 0 set ::num_tests 0
set ::num_passed 0 set ::num_passed 0
set ::num_failed 0 set ::num_failed 0
set ::num_skipped 0 set ::num_skipped 0
set ::num_aborted 0 set ::num_aborted 0
set ::tests_failed {} set ::tests_failed {}
set ::cur_test ""
proc fail {msg} { proc fail {msg} {
error "assertion:$msg" error "assertion:$msg"
} }
proc assert {condition} { proc assert {condition} {
if {![uplevel 1 [list expr $condition]]} { if {![uplevel 1 [list expr $condition]]} {
set context "(context: [info frame -1])" set context "(context: [info frame -1])"
error "assertion:Expected [uplevel 1 [list subst -nocommands $condition] ] $context" error "assertion:Expected [uplevel 1 [list subst -nocommands $condition] ] $context"
} }
skipping to change at line 102 skipping to change at line 103
return -code $errcode $result return -code $errcode $result
} }
after $delay after $delay
} }
if {$maxtries == -1} { if {$maxtries == -1} {
set errcode [catch [uplevel 1 $elsescript] result] set errcode [catch [uplevel 1 $elsescript] result]
return -code $errcode $result return -code $errcode $result
} }
} }
proc test {name code {okpattern undefined}} { proc test {name code {okpattern undefined} {options undefined}} {
# abort if tagged with a tag to deny
foreach tag $::denytags {
if {[lsearch $::tags $tag] >= 0} {
incr ::num_aborted
send_data_packet $::test_server_fd ignore $name
return
}
}
# abort if test name in skiptests # abort if test name in skiptests
if {[lsearch $::skiptests $name] >= 0} { if {[lsearch $::skiptests $name] >= 0} {
incr ::num_skipped incr ::num_skipped
send_data_packet $::test_server_fd skip $name send_data_packet $::test_server_fd skip $name
return return
} }
# abort if test name in skiptests # abort if test name in skiptests
if {[llength $::only_tests] > 0 && [lsearch $::only_tests $name] < 0} { if {[llength $::only_tests] > 0 && [lsearch $::only_tests $name] < 0} {
incr ::num_skipped incr ::num_skipped
skipping to change at line 146 skipping to change at line 138
incr ::num_aborted incr ::num_aborted
send_data_packet $::test_server_fd ignore $name send_data_packet $::test_server_fd ignore $name
return return
} }
} }
incr ::num_tests incr ::num_tests
set details {} set details {}
lappend details "$name in $::curfile" lappend details "$name in $::curfile"
# set a cur_test global to be logged into new servers that are spown
# and log the test name in all existing servers
set prev_test $::cur_test
set ::cur_test "$name in $::curfile"
if {!$::external} {
foreach srv $::servers {
set stdout [dict get $srv stdout]
set fd [open $stdout "a+"]
puts $fd "### Starting test $::cur_test"
close $fd
}
}
send_data_packet $::test_server_fd testing $name send_data_packet $::test_server_fd testing $name
if {[catch {set retval [uplevel 1 $code]} error]} { if {[catch {set retval [uplevel 1 $code]} error]} {
if {[string match "assertion:*" $error]} { set assertion [string match "assertion:*" $error]
if {$assertion || $::durable} {
set msg [string range $error 10 end] set msg [string range $error 10 end]
lappend details $msg lappend details $msg
if {!$assertion} {
lappend details $::errorInfo
}
lappend ::tests_failed $details lappend ::tests_failed $details
incr ::num_failed incr ::num_failed
send_data_packet $::test_server_fd err [join $details "\n"] send_data_packet $::test_server_fd err [join $details "\n"]
if {$::stop_on_failure} { if {$::stop_on_failure} {
puts "Test error (last server port:[srv port], log:[srv stdout]) , press enter to teardown the test." puts "Test error (last server port:[srv port], log:[srv stdout]) , press enter to teardown the test."
flush stdout flush stdout
gets stdin gets stdin
} }
skipping to change at line 186 skipping to change at line 195
send_data_packet $::test_server_fd err [join $details "\n"] send_data_packet $::test_server_fd err [join $details "\n"]
} }
} }
if {$::traceleaks} { if {$::traceleaks} {
set output [exec leaks redis-server] set output [exec leaks redis-server]
if {![string match {*0 leaks*} $output]} { if {![string match {*0 leaks*} $output]} {
send_data_packet $::test_server_fd err "Detected a memory leak in te st '$name': $output" send_data_packet $::test_server_fd err "Detected a memory leak in te st '$name': $output"
} }
} }
set ::cur_test $prev_test
} }
 End of changes. 6 change blocks. 
11 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)