about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-05-06 23:45:37 +0000
committerEric Wong <normalperson@yhbt.net>2013-05-07 00:06:37 +0000
commit3fe3459b3bec070a2618aae9d9c66c0fb15b680d (patch)
tree57608a39f268391eba44c5d77487a2fe843520d2
parenta63ee0342d89e6bc96605405a7b6a164b2875333 (diff)
downloadcmogstored-3fe3459b3bec070a2618aae9d9c66c0fb15b680d.tar.gz
Our use of chdir in this test confuses valgrind which may
create a temporary file.
-rw-r--r--test/test_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index b8e06ed..b08999f 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -9,6 +9,14 @@ require 'socket'
 require 'fileutils'
 $stderr.sync = $stdout.sync = Thread.abort_on_exception = true
 
+# use absolute path for TMPDIR to make our chdir tests happy with valgrind
+if tmpdir = ENV["TMPDIR"]
+  if tmpdir[0] != ?/
+    ENV["TMPDIR"] = File.expand_path(tmpdir)
+  end
+end
+
+
 TEST_HOST = ENV["TEST_HOST"] ||
             (RUBY_PLATFORM =~ /linux/ ?
              "127.#{rand(256)}.#{rand(256)}.#{rand(256)}" : "127.0.0.1")