summaryrefslogtreecommitdiffstats
path: root/src/test.h
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-01-06 19:34:10 (GMT)
committerEvan Martin <martine@danga.com>2012-01-06 19:34:10 (GMT)
commit36660e473b7f38317a38cc5a297ba18166191cf5 (patch)
tree063a8bc98ce298b911a81193ee2999ed2be03d9d /src/test.h
parentc633f316d74375b49808a0e98511ff224d519746 (diff)
downloadNinja-36660e473b7f38317a38cc5a297ba18166191cf5.zip
Ninja-36660e473b7f38317a38cc5a297ba18166191cf5.tar.gz
Ninja-36660e473b7f38317a38cc5a297ba18166191cf5.tar.bz2
migrate tempdir code to test.cc
Diffstat (limited to 'src/test.h')
-rw-r--r--src/test.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test.h b/src/test.h
index c8c2758..df544c6 100644
--- a/src/test.h
+++ b/src/test.h
@@ -61,4 +61,17 @@ struct VirtualFileSystem : public DiskInterface {
set<string> files_removed_;
};
+struct ScopedTempDir {
+ /// Create a temporary directory and chdir into it.
+ void CreateAndEnter(const string& name);
+
+ /// Clean up the temporary directory.
+ void Cleanup();
+
+ /// The temp directory containing our dir.
+ string start_dir_;
+ /// The subdirectory name for our dir, or empty if it hasn't been set up.
+ string temp_dir_name_;
+};
+
#endif // NINJA_TEST_H_