diff options
-rw-r--r-- | test/test_helper.rb | 8 |
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") |