Commit 36be34bb authored by antirez's avatar antirez
Browse files

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

parent 974514b9
...@@ -213,6 +213,8 @@ proc start_server {options {code undefined}} { ...@@ -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 &]
} }
......
...@@ -391,6 +391,7 @@ proc send_data_packet {fd status data} { ...@@ -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} { ...@@ -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}} {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment