diff options
author | Evan Martin <martine@danga.com> | 2011-03-05 21:31:46 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2011-03-05 21:31:46 (GMT) |
commit | ad118104f0892e53a5bdabaf1ffdcd597bf1b476 (patch) | |
tree | 647fa0104361a71dfcee2f00b9c73181c96639f2 | |
parent | 885ef827f0b6cf047cad8c8785bdc65838bfce4f (diff) | |
download | Ninja-ad118104f0892e53a5bdabaf1ffdcd597bf1b476.zip Ninja-ad118104f0892e53a5bdabaf1ffdcd597bf1b476.tar.gz Ninja-ad118104f0892e53a5bdabaf1ffdcd597bf1b476.tar.bz2 |
chdir into a temp dir before disk tests
-rw-r--r-- | src/ninja_test.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ninja_test.cc b/src/ninja_test.cc index 7ec77fd..646b4a9 100644 --- a/src/ninja_test.cc +++ b/src/ninja_test.cc @@ -197,6 +197,11 @@ public: ASSERT_TRUE(getcwd(buf, sizeof(buf))); start_dir_ = buf; + const char* tempdir = getenv("TMPDIR"); + if (!tempdir) + tempdir = "/tmp"; + ASSERT_EQ(0, chdir(tempdir)); + char name_template[] = "DiskInterfaceTest-XXXXXX"; char* name = mkdtemp(name_template); temp_dir_name_ = name; |