aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-01-26 21:04:36 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-01-26 21:04:36 +0000
commita32fc79c9af648cd500f9850975d04ae49ebda3f (patch)
tree473b9f4ac6a6311ba30e67cc6bbfb7263560d945 /src
parent650d5bf3ba200ecbeccbfcec6e7b6cc6f40a1f60 (diff)
downloadgoogletest-a32fc79c9af648cd500f9850975d04ae49ebda3f.tar.gz
googletest-a32fc79c9af648cd500f9850975d04ae49ebda3f.tar.bz2
googletest-a32fc79c9af648cd500f9850975d04ae49ebda3f.zip
Simplifies gtest's implementation by using an existing API to get the original working directory.
Diffstat (limited to 'src')
-rw-r--r--src/gtest.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gtest.cc b/src/gtest.cc
index d6be608a..903dcd94 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -289,7 +289,6 @@ Mutex g_linked_ptr_mutex(Mutex::NO_CONSTRUCTOR_NEEDED_FOR_STATIC_MUTEX);
// Application pathname gotten in InitGoogleTest.
String g_executable_path;
-String g_original_working_dir;
// Returns the current application's name, removing directory path if that
// is present.
@@ -328,7 +327,8 @@ String UnitTestOptions::GetAbsolutePathToOutputFile() {
const char* const colon = strchr(gtest_output_flag, ':');
if (colon == NULL)
return String(internal::FilePath::ConcatPaths(
- internal::FilePath(g_original_working_dir),
+ internal::FilePath(
+ UnitTest::GetInstance()->original_working_dir()),
internal::FilePath(kDefaultOutputFile)).ToString() );
internal::FilePath output_name(colon + 1);
@@ -338,8 +338,8 @@ String UnitTestOptions::GetAbsolutePathToOutputFile() {
// following logic for turning it into an absolute path is wrong.
// Fix it.
output_name = internal::FilePath::ConcatPaths(
- internal::FilePath(g_original_working_dir),
- internal::FilePath(colon + 1));
+ internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
+ internal::FilePath(colon + 1));
if (!output_name.IsDirectory())
return output_name.ToString();
@@ -3938,8 +3938,6 @@ void InitGoogleTestImpl(int* argc, CharType** argv) {
if (*argc <= 0) return;
internal::g_executable_path = internal::StreamableToString(argv[0]);
- internal::g_original_working_dir =
- internal::FilePath::GetCurrentDir().ToString();
#ifdef GTEST_HAS_DEATH_TEST
g_argvs.clear();