summaryrefslogtreecommitdiffstats
path: root/googletest/src/gtest-internal-inl.h
diff options
context:
space:
mode:
authorKnut Petter Svendsen <knut@altuma.no>2020-10-29 15:47:10 (GMT)
committerKnut Petter Svendsen <knut.svendsen@kdef.cloud>2020-11-09 09:04:43 (GMT)
commite5686bb18b52dc29312a7b79c3d6ca2c826c31ed (patch)
tree4330c48583ae848fafa164ce5d6452629325f040 /googletest/src/gtest-internal-inl.h
parent3005672db1d05f2378f642b61faa96f85498befe (diff)
downloadgoogletest-e5686bb18b52dc29312a7b79c3d6ca2c826c31ed.zip
googletest-e5686bb18b52dc29312a7b79c3d6ca2c826c31ed.tar.gz
googletest-e5686bb18b52dc29312a7b79c3d6ca2c826c31ed.tar.bz2
Only save original working directory if death tests are enabledrefs/pull/3090/head
On a diskless system you cannot get the current directory. So if death tests are disabled anyway, there is no point trying to get current directory. Without this fix, running tests on diskless systems will fail, even when death tests are disabled.
Diffstat (limited to 'googletest/src/gtest-internal-inl.h')
-rw-r--r--googletest/src/gtest-internal-inl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/googletest/src/gtest-internal-inl.h b/googletest/src/gtest-internal-inl.h
index aef5571..5f75f8b 100644
--- a/googletest/src/gtest-internal-inl.h
+++ b/googletest/src/gtest-internal-inl.h
@@ -682,6 +682,7 @@ class GTEST_API_ UnitTestImpl {
void AddTestInfo(internal::SetUpTestSuiteFunc set_up_tc,
internal::TearDownTestSuiteFunc tear_down_tc,
TestInfo* test_info) {
+#if GTEST_HAS_DEATH_TEST
// 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
@@ -694,6 +695,7 @@ class GTEST_API_ UnitTestImpl {
GTEST_CHECK_(!original_working_dir_.IsEmpty())
<< "Failed to get the current working directory.";
}
+#endif
GetTestSuite(test_info->test_suite_name(), test_info->type_param(),
set_up_tc, tear_down_tc)