Simplifies implementation by defining a POSIX portability layer; adds the death test style flag to --help.
This commit is contained in:
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user