Test: support for stack logging for OSX malloc/leaks.

This commit is contained in:
antirez 2015-09-23 10:34:00 +02:00
parent 974514b936
commit 36be34bb87
2 changed files with 7 additions and 0 deletions

View File

@ -213,6 +213,8 @@ proc start_server {options {code undefined}} {
if {$::valgrind} { if {$::valgrind} {
set pid [exec valgrind --track-origins=yes --suppressions=src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full src/redis-server $config_file > $stdout 2> $stderr &] set pid [exec valgrind --track-origins=yes --suppressions=src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full src/redis-server $config_file > $stdout 2> $stderr &]
} elseif ($::stack_logging) {
set pid [exec /usr/bin/env MallocStackLogging=1 MallocLogFile=/tmp/malloc_log.txt src/redis-server $config_file > $stdout 2> $stderr &]
} else { } else {
set pid [exec src/redis-server $config_file > $stdout 2> $stderr &] set pid [exec src/redis-server $config_file > $stdout 2> $stderr &]
} }

View File

@ -391,6 +391,7 @@ proc send_data_packet {fd status data} {
proc print_help_screen {} { proc print_help_screen {} {
puts [join { puts [join {
"--valgrind Run the test over valgrind." "--valgrind Run the test over valgrind."
"--stack-logging Enable OSX leaks/malloc stack logging."
"--accurate Run slow randomized tests for more iterations." "--accurate Run slow randomized tests for more iterations."
"--quiet Don't show individual tests." "--quiet Don't show individual tests."
"--single <unit> Just execute the specified unit (see next option)." "--single <unit> Just execute the specified unit (see next option)."
@ -417,6 +418,10 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
incr j incr j
} elseif {$opt eq {--valgrind}} { } elseif {$opt eq {--valgrind}} {
set ::valgrind 1 set ::valgrind 1
} elseif {$opt eq {--stack-logging}} {
if {[string match {*Darwin*} [exec uname -a]]} {
set ::stack_logging 1
}
} elseif {$opt eq {--quiet}} { } elseif {$opt eq {--quiet}} {
set ::quiet 1 set ::quiet 1
} elseif {$opt eq {--host}} { } elseif {$opt eq {--host}} {