Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2019 07:21:22 +0000 (UTC)
From:      Enji Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r344344 - projects/import-googletest-1.8.1/contrib/googletest/googletest/test
Message-ID:  <201902200721.x1K7LMd0025104@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902200721.x1K7LMd0025104>