Don't hardcode the source filename
In order to compile these tests with different CXXFLAGS, I needed to copy them to different filenames to trick the compiler. Unfortunately, this triggers a failure with one of the tests as it hardcodes the path to the test, instead of relying on the compiler to fill in the path via `__FILE__`. Using `__FILE__` is standard and works. Rely on it instead of a hardcoded path.
This commit is contained in:
parent
f53e266234
commit
7ea28b21e4
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user