]> git.saurik.com Git - redis.git/commitdiff
check for memory leaks before killing a server
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Fri, 14 May 2010 15:49:39 +0000 (17:49 +0200)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Fri, 14 May 2010 15:49:39 +0000 (17:49 +0200)
test/support/server.tcl

index 62d9ec9e61fbc03bcc1229f35799f1e9ace524b7..53ca468308c64a5d8724f170253528bfb012eadf 100644 (file)
@@ -10,6 +10,15 @@ proc error_and_quit {config_file error} {
 proc kill_server config {
     set pid [dict get $config pid]
 
+    # check for leaks
+    catch {
+        if {[string match {*Darwin*} [exec uname -a]]} {
+            test {Check for memory leaks} {
+                exec leaks $pid
+            } {*0 leaks*}
+        }
+    }
+
     # kill server and wait for the process to be totally exited
     exec kill $pid
     while 1 {