about summary refs log tree commit homepage
path: root/test/test_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_helper.rb')
-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")