Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
36be34bb
Commit
36be34bb
authored
Sep 23, 2015
by
antirez
Browse files
Test: support for stack logging for OSX malloc/leaks.
parent
974514b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/support/server.tcl
View file @
36be34bb
...
@@ -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 &
]
}
}
...
...
tests/test_helper.tcl
View file @
36be34bb
...
@@ -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
}}
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment