diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-05-06 23:45:37 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-05-11 11:29:41 +0000 |
commit | dc801d4a4ded67d74f5306d6dad4aba629045cc8 (patch) | |
tree | 57608a39f268391eba44c5d77487a2fe843520d2 | |
parent | 0c918c095d8f611f8d0072db468e37683597ef01 (diff) | |
download | cmogstored-dc801d4a4ded67d74f5306d6dad4aba629045cc8.tar.gz |
Our use of chdir in this test confuses valgrind which may create a temporary file.
-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 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") |