Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
a32fc79c
Commit
a32fc79c
authored
Jan 26, 2009
by
zhanyong.wan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplifies gtest's implementation by using an existing API to get the original working directory.
parent
650d5bf3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
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);
...
@@ -289,7 +289,6 @@ Mutex g_linked_ptr_mutex(Mutex::NO_CONSTRUCTOR_NEEDED_FOR_STATIC_MUTEX);
// Application pathname gotten in InitGoogleTest.
// Application pathname gotten in InitGoogleTest.
String
g_executable_path
;
String
g_executable_path
;
String
g_original_working_dir
;
// Returns the current application's name, removing directory path if that
// Returns the current application's name, removing directory path if that
// is present.
// is present.
...
@@ -328,7 +327,8 @@ String UnitTestOptions::GetAbsolutePathToOutputFile() {
...
@@ -328,7 +327,8 @@ String UnitTestOptions::GetAbsolutePathToOutputFile() {
const
char
*
const
colon
=
strchr
(
gtest_output_flag
,
':'
);
const
char
*
const
colon
=
strchr
(
gtest_output_flag
,
':'
);
if
(
colon
==
NULL
)
if
(
colon
==
NULL
)
return
String
(
internal
::
FilePath
::
ConcatPaths
(
return
String
(
internal
::
FilePath
::
ConcatPaths
(
internal
::
FilePath
(
g_original_working_dir
),
internal
::
FilePath
(
UnitTest
::
GetInstance
()
->
original_working_dir
()),
internal
::
FilePath
(
kDefaultOutputFile
)).
ToString
()
);
internal
::
FilePath
(
kDefaultOutputFile
)).
ToString
()
);
internal
::
FilePath
output_name
(
colon
+
1
);
internal
::
FilePath
output_name
(
colon
+
1
);
...
@@ -338,8 +338,8 @@ String UnitTestOptions::GetAbsolutePathToOutputFile() {
...
@@ -338,8 +338,8 @@ String UnitTestOptions::GetAbsolutePathToOutputFile() {
// following logic for turning it into an absolute path is wrong.
// following logic for turning it into an absolute path is wrong.
// Fix it.
// Fix it.
output_name
=
internal
::
FilePath
::
ConcatPaths
(
output_name
=
internal
::
FilePath
::
ConcatPaths
(
internal
::
FilePath
(
g_original_working_dir
),
internal
::
FilePath
(
UnitTest
::
GetInstance
()
->
original_working_dir
()
),
internal
::
FilePath
(
colon
+
1
));
internal
::
FilePath
(
colon
+
1
));
if
(
!
output_name
.
IsDirectory
())
if
(
!
output_name
.
IsDirectory
())
return
output_name
.
ToString
();
return
output_name
.
ToString
();
...
@@ -3938,8 +3938,6 @@ void InitGoogleTestImpl(int* argc, CharType** argv) {
...
@@ -3938,8 +3938,6 @@ void InitGoogleTestImpl(int* argc, CharType** argv) {
if
(
*
argc
<=
0
)
return
;
if
(
*
argc
<=
0
)
return
;
internal
::
g_executable_path
=
internal
::
StreamableToString
(
argv
[
0
]);
internal
::
g_executable_path
=
internal
::
StreamableToString
(
argv
[
0
]);
internal
::
g_original_working_dir
=
internal
::
FilePath
::
GetCurrentDir
().
ToString
();
#ifdef GTEST_HAS_DEATH_TEST
#ifdef GTEST_HAS_DEATH_TEST
g_argvs
.
clear
();
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