aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-04-24 00:26:25 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-04-24 00:26:25 +0000
commitf2d0d0e3d56794855d1e9a1f157457b7225e8c88 (patch)
treec31ceb2e69ca6e51ebef7a3978bd7d7f900db6a1 /test
parentf204cd89e591e8cda022f4b471962c8556e19b8c (diff)
downloadgoogletest-f2d0d0e3d56794855d1e9a1f157457b7225e8c88.tar.gz
googletest-f2d0d0e3d56794855d1e9a1f157457b7225e8c88.tar.bz2
googletest-f2d0d0e3d56794855d1e9a1f157457b7225e8c88.zip
Renames the POSIX wrappers (by Zhanyong Wan) and adds more targets to SConscript (by Vlad Losev).
Diffstat (limited to 'test')
-rw-r--r--test/gtest-death-test_test.cc4
-rw-r--r--test/gtest-filepath_test.cc12
-rw-r--r--test/gtest-options_test.cc4
-rw-r--r--test/gtest_output_test_.cc4
-rwxr-xr-xtest/gtest_throw_on_failure_test.py3
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