diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gtest-death-test_test.cc | 4 | ||||
-rw-r--r-- | test/gtest-filepath_test.cc | 12 | ||||
-rw-r--r-- | test/gtest-options_test.cc | 4 | ||||
-rw-r--r-- | test/gtest_output_test_.cc | 4 | ||||
-rwxr-xr-x | test/gtest_throw_on_failure_test.py | 3 |
5 files changed, 14 insertions, 13 deletions
diff --git a/test/gtest-death-test_test.cc b/test/gtest-death-test_test.cc index db5f72e0..9dd477b2 100644 --- a/test/gtest-death-test_test.cc +++ b/test/gtest-death-test_test.cc @@ -106,7 +106,7 @@ class TestForDeathTest : public testing::Test { TestForDeathTest() : original_dir_(FilePath::GetCurrentDir()) {} virtual ~TestForDeathTest() { - posix::chdir(original_dir_.c_str()); + posix::ChDir(original_dir_.c_str()); } // A static member function that's expected to die. @@ -345,7 +345,7 @@ TEST_F(TestForDeathTest, MemberFunctionFastStyle) { EXPECT_DEATH(MemberFunction(), "inside.*MemberFunction"); } -void ChangeToRootDir() { posix::chdir(GTEST_PATH_SEP_); } +void ChangeToRootDir() { posix::ChDir(GTEST_PATH_SEP_); } // Tests that death tests work even if the current directory has been // changed. diff --git a/test/gtest-filepath_test.cc b/test/gtest-filepath_test.cc index 77a2988e..b6d950dd 100644 --- a/test/gtest-filepath_test.cc +++ b/test/gtest-filepath_test.cc @@ -86,9 +86,9 @@ TEST(GetCurrentDirTest, ReturnsCurrentDir) { const FilePath original_dir = FilePath::GetCurrentDir(); EXPECT_FALSE(original_dir.IsEmpty()); - posix::chdir(GTEST_PATH_SEP_); + posix::ChDir(GTEST_PATH_SEP_); const FilePath cwd = FilePath::GetCurrentDir(); - posix::chdir(original_dir.c_str()); + posix::ChDir(original_dir.c_str()); #if GTEST_OS_WINDOWS // Skips the ":". @@ -435,14 +435,14 @@ class DirectoryCreationTest : public Test { remove(testdata_file_.c_str()); remove(unique_file0_.c_str()); remove(unique_file1_.c_str()); - posix::rmdir(testdata_path_.c_str()); + posix::RmDir(testdata_path_.c_str()); } virtual void TearDown() { remove(testdata_file_.c_str()); remove(unique_file0_.c_str()); remove(unique_file1_.c_str()); - posix::rmdir(testdata_path_.c_str()); + posix::RmDir(testdata_path_.c_str()); } String TempDir() const { @@ -450,7 +450,7 @@ class DirectoryCreationTest : public Test { return String("\\temp\\"); #elif GTEST_OS_WINDOWS - const char* temp_dir = posix::getenv("TEMP"); + const char* temp_dir = posix::GetEnv("TEMP"); if (temp_dir == NULL || temp_dir[0] == '\0') return String("\\temp\\"); else if (String(temp_dir).EndsWith("\\")) @@ -463,7 +463,7 @@ class DirectoryCreationTest : public Test { } void CreateTextFile(const char* filename) { - FILE* f = posix::fopen(filename, "w"); + FILE* f = posix::FOpen(filename, "w"); fprintf(f, "text\n"); fclose(f); } diff --git a/test/gtest-options_test.cc b/test/gtest-options_test.cc index d49efe49..43c6d22d 100644 --- a/test/gtest-options_test.cc +++ b/test/gtest-options_test.cc @@ -150,14 +150,14 @@ class XmlOutputChangeDirTest : public Test { protected: virtual void SetUp() { original_working_dir_ = FilePath::GetCurrentDir(); - posix::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() { - posix::chdir(original_working_dir_.c_str()); + posix::ChDir(original_working_dir_.c_str()); } FilePath original_working_dir_; diff --git a/test/gtest_output_test_.cc b/test/gtest_output_test_.cc index 4d7f0758..9c92d8cc 100644 --- a/test/gtest_output_test_.cc +++ b/test/gtest_output_test_.cc @@ -991,9 +991,9 @@ int main(int argc, char **argv) { // Skip the usual output capturing if we're running as the child // process of an threadsafe-style death test. #if GTEST_OS_WINDOWS - posix::freopen("nul:", "w", stdout); + posix::FReopen("nul:", "w", stdout); #else - posix::freopen("/dev/null", "w", stdout); + posix::FReopen("/dev/null", "w", stdout); #endif // GTEST_OS_WINDOWS return RUN_ALL_TESTS(); } diff --git a/test/gtest_throw_on_failure_test.py b/test/gtest_throw_on_failure_test.py index 50172d07..e952da5a 100755 --- a/test/gtest_throw_on_failure_test.py +++ b/test/gtest_throw_on_failure_test.py @@ -72,7 +72,8 @@ def Run(command): """Runs a command; returns True/False if its exit code is/isn't 0.""" print 'Running "%s". . .' % ' '.join(command) - return gtest_test_utils.Subprocess(command).exit_code == 0 + p = gtest_test_utils.Subprocess(command) + return p.exited and p.exit_code == 0 # The tests. TODO(wan@google.com): refactor the class to share common |