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-11 11:30:27 +0000
commitd698442186bfa7c1b35e68720412c9add422616c (patch)
treea2018d40f16472fe7e400640273fd057485f6341
parente247cd327850090dca3d500bc4abcafb3d098875 (diff)
downloadcmogstored-d698442186bfa7c1b35e68720412c9add422616c.tar.gz
Our use of chdir in this test confuses valgrind which may
create a temporary file.
(cherry picked from commit dc801d4a4ded67d74f5306d6dad4aba629045cc8)
-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 588f4df..153ca9f 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")