svn commit: r344344 - projects/import-googletest-1.8.1/contrib/googletest/googletest/test

Enji Cooper ngie at FreeBSD.org
Wed Feb 20 07:21:23 UTC 2019


Author: ngie
Date: Wed Feb 20 07:21:22 2019
New Revision: 344344
URL: https://svnweb.freebsd.org/changeset/base/344344

Log:
  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.

Modified:
  projects/import-googletest-1.8.1/contrib/googletest/googletest/test/googletest-death-test_ex_test.cc

Modified: projects/import-googletest-1.8.1/contrib/googletest/googletest/test/googletest-death-test_ex_test.cc
==============================================================================
--- projects/import-googletest-1.8.1/contrib/googletest/googletest/test/googletest-death-test_ex_test.cc	Wed Feb 20 07:10:38 2019	(r344343)
+++ projects/import-googletest-1.8.1/contrib/googletest/googletest/test/googletest-death-test_ex_test.cc	Wed Feb 20 07:21:22 2019	(r344344)
@@ -68,7 +68,7 @@ TEST(CxxExceptionDeathTest, PrintsMessageForStdExcepti
                           "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
 


More information about the svn-src-projects mailing list