Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
a32fc79c
Commit
a32fc79c
authored
Jan 26, 2009
by
zhanyong.wan
Browse files
Simplifies gtest's implementation by using an existing API to get the original working directory.
parent
650d5bf3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
src/gtest.cc
src/gtest.cc
+4
-6
No files found.
src/gtest.cc
View file @
a32fc79c
...
...
@@ -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,7 +338,7 @@ 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
(
UnitTest
::
GetInstance
()
->
original_working_dir
()
),
internal
::
FilePath
(
colon
+
1
));
if
(
!
output_name
.
IsDirectory
())
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment