summaryrefslogtreecommitdiff
path: root/tests/instances.tcl
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2015-01-09 17:43:48 -0500
committerantirez <antirez@gmail.com>2015-01-21 15:04:12 +0100
commitb0146aafebd76e89638fe6b13947d0a53f5c7b27 (patch)
tree276067a1f1e73cfb55e862a950fa59db49b76c3e /tests/instances.tcl
parent92cfab44b240750d957ae226efac7235c7ef655b (diff)
downloadredis-b0146aafebd76e89638fe6b13947d0a53f5c7b27.tar.gz
Tell sentinel/cluster tests to allow valgrind
Diffstat (limited to 'tests/instances.tcl')
-rw-r--r--tests/instances.tcl19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/instances.tcl b/tests/instances.tcl
index 426508f33..b9eb42258 100644
--- a/tests/instances.tcl
+++ b/tests/instances.tcl
@@ -16,6 +16,7 @@ source ../support/server.tcl
source ../support/test.tcl
set ::verbose 0
+set ::valgrind 0
set ::pause_on_error 0
set ::simulate_error 0
set ::sentinel_instances {}
@@ -65,7 +66,13 @@ proc spawn_instance {type base_port count {conf {}}} {
} else {
error "Unknown instance type."
}
- set pid [exec ../../../src/${prgname} $cfgfile &]
+
+ if {$::valgrind} {
+ set pid [exec valgrind --suppressions=../../../src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full ../../../src/${prgname} $cfgfile &]
+ } else {
+ set pid [exec ../../../src/${prgname} $cfgfile &]
+ }
+
lappend ::pids $pid
# Check availability
@@ -113,6 +120,8 @@ proc parse_options {} {
set ::pause_on_error 1
} elseif {$opt eq "--fail"} {
set ::simulate_error 1
+ } elseif {$opt eq {--valgrind}} {
+ set ::valgrind 1
} elseif {$opt eq "--help"} {
puts "Hello, I'm sentinel.tcl and I run Sentinel unit tests."
puts "\nOptions:"
@@ -390,7 +399,13 @@ proc restart_instance {type id} {
} else {
set prgname redis-sentinel
}
- set pid [exec ../../../src/${prgname} $cfgfile &]
+
+ if {$::valgrind} {
+ set pid [exec valgrind --suppressions=../../../src/valgrind.sup --show-reachable=no --show-possibly-lost=no --leak-check=full ../../../src/${prgname} $cfgfile &]
+ } else {
+ set pid [exec ../../../src/${prgname} $cfgfile &]
+ }
+
set_instance_attrib $type $id pid $pid
lappend ::pids $pid