summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
authorEnji Cooper <yaneurabeya@gmail.com>2019-02-21 20:01:30 (GMT)
committerEnji Cooper <yaneurabeya@gmail.com>2019-02-21 20:10:15 (GMT)
commitcd09534deccdaf4bc55e5623d0ec6b11a4b58f9a (patch)
tree89288e7c0e839a755ccb9d091f0e6bda19a84bd7 /googletest
parent7203f37f57e4fef0d77670098aabc186309eb874 (diff)
downloadgoogletest-cd09534deccdaf4bc55e5623d0ec6b11a4b58f9a.zip
googletest-cd09534deccdaf4bc55e5623d0ec6b11a4b58f9a.tar.gz
googletest-cd09534deccdaf4bc55e5623d0ec6b11a4b58f9a.tar.bz2
Don't hardcode the filename in `CxxExceptionDeathTest.PrintsMessageForStdException`refs/pull/2147/head
Due to some caveats in the FreeBSD build system and the fact that the source file is used to compile 2 different death tests with different flags, I needed (as a shortterm workaround) to copy the test to 2 differently named files. While this works for compiling the test, as I discovered, this doesn't work with running `CxxExceptionDeathTest.PrintsMessageForStdException`, as the testcase hardcodes `googletest-death-test_ex_test.cc`. Use `__FILE__` when looking for failures, as opposed to looking for the hardcoded name as it can vary depending on how the test was built. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Diffstat (limited to 'googletest')
-rw-r--r--googletest/test/googletest-death-test_ex_test.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/googletest/test/googletest-death-test_ex_test.cc b/googletest/test/googletest-death-test_ex_test.cc
index cf0d970..7ea5b94 100644
--- a/googletest/test/googletest-death-test_ex_test.cc
+++ b/googletest/test/googletest-death-test_ex_test.cc
@@ -68,7 +68,7 @@ TEST(CxxExceptionDeathTest, PrintsMessageForStdExceptions) {
"exceptional message");
// Verifies that the location is mentioned in the failure text.
EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw TestException(), ""),
- "googletest-death-test_ex_test.cc");
+ __FILE__);
}
# endif // GTEST_HAS_EXCEPTIONS