Simplifies implementation by defining a POSIX portability layer; adds the death test style flag to --help.

This commit is contained in:
zhanyong.wan
2009-03-26 19:03:47 +00:00
parent f3c6efd8d7
commit 3c7bbf5b46
12 changed files with 184 additions and 268 deletions

View File

@@ -150,22 +150,14 @@ class XmlOutputChangeDirTest : public Test {
protected:
virtual void SetUp() {
original_working_dir_ = FilePath::GetCurrentDir();
ChDir("..");
posix::chdir("..");
// This will make the test fail if run from the root directory.
EXPECT_STRNE(original_working_dir_.c_str(),
FilePath::GetCurrentDir().c_str());
}
virtual void TearDown() {
ChDir(original_working_dir_.c_str());
}
void ChDir(const char* dir) {
#if GTEST_OS_WINDOWS
_chdir(dir);
#else
chdir(dir);
#endif
posix::chdir(original_working_dir_.c_str());
}
FilePath original_working_dir_;