Skip to content

Commit

Permalink
Check for file system for current directory
Browse files Browse the repository at this point in the history
Check for current directory instead of death test to get original directory.

A port may support filesystems but not death tests.
  • Loading branch information
elupus committed Jun 2, 2023
1 parent 06f44bc commit 001f281
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions googletest/src/gtest-internal-inl.h
Expand Up @@ -672,7 +672,7 @@ class GTEST_API_ UnitTestImpl {
void AddTestInfo(internal::SetUpTestSuiteFunc set_up_tc,
internal::TearDownTestSuiteFunc tear_down_tc,
TestInfo* test_info) {
#ifdef GTEST_HAS_DEATH_TEST
#ifdef GTEST_HAS_FILE_SYSTEM
// In order to support thread-safe death tests, we need to
// remember the original working directory when the test program
// was first invoked. We cannot do this in RUN_ALL_TESTS(), as
Expand All @@ -685,7 +685,7 @@ class GTEST_API_ UnitTestImpl {
GTEST_CHECK_(!original_working_dir_.IsEmpty())
<< "Failed to get the current working directory.";
}
#endif // GTEST_HAS_DEATH_TEST
#endif // GTEST_HAS_FILE_SYSTEM

GetTestSuite(test_info->test_suite_name(), test_info->type_param(),
set_up_tc, tear_down_tc)
Expand Down

0 comments on commit 001f281

Please sign in to comment.