Hello.

Reasoning:

The devel/abseil-cpp port comes with the tests turned off. I
promised to fix this, so I've been working on the port for a while.
Unfortunately, the abseil tests require some features that are
missing even in the latest stable gtest release.
Therefore, my diff includes an update to version 1.11.0 as well as
the patches needed to build the abseil tests.

A fix for the 'gtest-help-test' test has also been added. All other
tests succeed as it is.

What is not done:
I have not yet checked all the ports that have a dependency on gtest.
There aren't many, but I only have a not-so-fast computer available
right now, so it's going to take some time.
If anyone has a fast machine and is interested in making these
changes and/or just wants to help, I'd be thankful.

Checked ports:

Everything is OK: devel/gtest, devel/abseil-cpp, audio/chromaprint,
        multimedia/openh264, geo/lib2geom, www/gumbo, security/rnp,
        productivity/libphonenumber.

graphics/mpeg-lib       - segmentation fault on make test, however,
                          same with gtest 1.8.1.
geo/mdal                - 97% tests passed, 1 tests failed out of 31,
same with gtest 1.8.1. textproc/luceneplusplus - 1 tests failed, seems to be unrelated to
                          gtest
x11/xsettingsd          - 93% tests passed, 1 tests failed out of 14,
                          same with gtest 1.8.1.
devel/msgpack           - tests only compile if you add this line:

'CONFIGURE_ARGS +=      -DCMAKE_CXX_STANDARD=17'

                          to devel/msgpack/Makefile.

orthanc/server          - gtest in LIB_DEPENDS, but no tests.
                          Port built successfully.
devel/proj              - 91% tests passed, 5 tests failed out of 58,
                          errors seems to be unrelated to gtest.

Unchecked (yet?) ports:

net/barrier
multimedia/mkvtoolnix
productivity/gnucash
graphics/inkscape
emulators/dolphin

I would be happy for comments, objections and criticism.

Patch:

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/gtest/Makefile,v
retrieving revision 1.25
diff -u -p -r1.25 Makefile
--- Makefile    31 Oct 2021 16:09:26 -0000      1.25
+++ Makefile    5 Feb 2022 01:53:04 -0000
@@ -5,7 +5,7 @@ BROKEN-alpha =  googletest/test/gtest_uni
COMMENT = C++ unit test framework -V= 1.8.1
+V=             1.11.0
 GH_ACCOUNT=    google
 GH_PROJECT=    googletest
 GH_TAGNAME=    release-$V
@@ -25,6 +25,26 @@ HOMEPAGE =   https://github.com/google/goo
 CXXFLAGS +=    -mxgot
 .endif
+MASTER_SITES0 = https://github.com/google/googletest/commit/
+
+PATCHFILES +=          fix-typos-in-docs-{}355d57d9.patch:0
+PATCHFILES +=          impl-contains-time-matcher-mod-{}4ec4cd23.patch:0
+PATCHFILES +=          dont-recreate-envs-when-repeating-{}4cfd1498.patch:0
+# required for abseil (GTEST_FLAG_GET)
+PATCHFILES +=          add-gtest-flag-get-set-{}977cffc4.patch:0
+
+PATCHFILES +=          rand-seed-even-if-shuffling-disabled-{}3ea58705.patch:0
+# required for abseil (testing::Conditional)
+PATCHFILES +=          add-conditional-wrapper-{}8306020a.patch:0
+
+PATCHFILES +=          port-to-hurd-{}05e9fa23.patch:0
+# Fix gtest-help-test failure on OpenBSD
+# https://github.com/google/googletest/pull/3751
+PATCHFILES +=          fix-gtest-help-test-{}631f4f99.patch:0
+
+PATCH_DIST_STRIP =     -p1
+
+
 # New BSD
 PERMIT_PACKAGE =       Yes
@@ -35,7 +55,12 @@ WANTLIB = m ${COMPILER_LIBCXX}
 COMPILER =             base-clang ports-gcc base-gcc
MODULES += devel/cmake
-CONFIGURE_ARGS =       -DBUILD_SHARED_LIBS=ON \
+CONFIGURE_ARGS +=      -DBUILD_SHARED_LIBS=ON \
                        -Dgtest_build_tests=ON
+
+# c++ standard must be the same as in devel/abseil-cpp,
+# otherwise the build of abseil tests will end with an error
+# see https://github.com/abseil/abseil-cpp/issues/819
+CONFIGURE_ARGS +=      -DCMAKE_CXX_STANDARD=17
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/gtest/distinfo,v
retrieving revision 1.5
diff -u -p -r1.5 distinfo
--- distinfo    31 Oct 2021 16:09:26 -0000      1.5
+++ distinfo    5 Feb 2022 01:53:04 -0000
@@ -1,2 +1,18 @@
-SHA256 (googletest-1.8.1.tar.gz) = m/H+UYKmBLQTXtwaQlrjVsmtFemyP58SoC6AGEw6JJw=
-SIZE (googletest-1.8.1.tar.gz) = 992298
+SHA256 (add-conditional-wrapper-8306020a.patch) = 
+kROJjaB1jpoxyHI/EORUy+aBeqPNQNukt5VBbq5rzI=
+SHA256 (add-gtest-flag-get-set-977cffc4.patch) = 
36TYO69KMCOXcicOfdkvTjBE+nEdqej7CMP+AJTFGdY=
+SHA256 (dont-recreate-envs-when-repeating-4cfd1498.patch) = 
l6LjnGTVQh3/LaWf1OzpIConJDIblk6c8dGJ9srvhXs=
+SHA256 (fix-gtest-help-test-631f4f99.patch) = 
irvc5uvRbb+BE3mKGVtoIHX9GEcRuLYTWEjTRcPzrsA=
+SHA256 (fix-typos-in-docs-355d57d9.patch) = 
X1zbUqi/32BhT8IljO+nUAE1rOINv2OXCB/C4d8RdMU=
+SHA256 (googletest-1.11.0.tar.gz) = 
tIcL8SH/d5W6INILzdhie44Ijy0dqymaAxwQNO3ck9U=
+SHA256 (impl-contains-time-matcher-mod-4ec4cd23.patch) = 
wGRnfWinoqhN+y2+qpLY5fsVVKl3g/1xzrMgaSReSzA=
+SHA256 (port-to-hurd-05e9fa23.patch) = 
I3SFTmH6hc05fNJuQFKUrq9wBJ6tRqK1U/MrXmKcsRo=
+SHA256 (rand-seed-even-if-shuffling-disabled-3ea58705.patch) = 
DoalboMsLRdIkpP/ERhGCDpSa21+HGpbPZnCSJe7k54=
+SIZE (add-conditional-wrapper-8306020a.patch) = 5762
+SIZE (add-gtest-flag-get-set-977cffc4.patch) = 99360
+SIZE (dont-recreate-envs-when-repeating-4cfd1498.patch) = 17501
+SIZE (fix-gtest-help-test-631f4f99.patch) = 1285
+SIZE (fix-typos-in-docs-355d57d9.patch) = 8578
+SIZE (googletest-1.11.0.tar.gz) = 886330
+SIZE (impl-contains-time-matcher-mod-4ec4cd23.patch) = 14511
+SIZE (port-to-hurd-05e9fa23.patch) = 4925
+SIZE (rand-seed-even-if-shuffling-disabled-3ea58705.patch) = 954
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/gtest/pkg/PLIST,v
retrieving revision 1.4
diff -u -p -r1.4 PLIST
--- pkg/PLIST   31 Oct 2021 16:09:26 -0000      1.4
+++ pkg/PLIST   5 Feb 2022 01:53:04 -0000
@@ -2,35 +2,27 @@
 include/gmock/
 include/gmock/gmock-actions.h
 include/gmock/gmock-cardinalities.h
-include/gmock/gmock-generated-actions.h
-include/gmock/gmock-generated-actions.h.pump
-include/gmock/gmock-generated-function-mockers.h
-include/gmock/gmock-generated-function-mockers.h.pump
-include/gmock/gmock-generated-matchers.h
-include/gmock/gmock-generated-matchers.h.pump
-include/gmock/gmock-generated-nice-strict.h
-include/gmock/gmock-generated-nice-strict.h.pump
+include/gmock/gmock-function-mocker.h
 include/gmock/gmock-matchers.h
 include/gmock/gmock-more-actions.h
 include/gmock/gmock-more-matchers.h
+include/gmock/gmock-nice-strict.h
 include/gmock/gmock-spec-builders.h
 include/gmock/gmock.h
 include/gmock/internal/
 include/gmock/internal/custom/
 include/gmock/internal/custom/README.md
 include/gmock/internal/custom/gmock-generated-actions.h
-include/gmock/internal/custom/gmock-generated-actions.h.pump
 include/gmock/internal/custom/gmock-matchers.h
 include/gmock/internal/custom/gmock-port.h
-include/gmock/internal/gmock-generated-internal-utils.h
-include/gmock/internal/gmock-generated-internal-utils.h.pump
 include/gmock/internal/gmock-internal-utils.h
 include/gmock/internal/gmock-port.h
+include/gmock/internal/gmock-pp.h
 include/gtest/
 include/gtest/gtest-death-test.h
+include/gtest/gtest-matchers.h
 include/gtest/gtest-message.h
 include/gtest/gtest-param-test.h
-include/gtest/gtest-param-test.h.pump
 include/gtest/gtest-printers.h
 include/gtest/gtest-spi.h
 include/gtest/gtest-test-part.h
@@ -47,17 +39,11 @@ include/gtest/internal/custom/gtest.h
 include/gtest/internal/gtest-death-test-internal.h
 include/gtest/internal/gtest-filepath.h
 include/gtest/internal/gtest-internal.h
-include/gtest/internal/gtest-linked_ptr.h
-include/gtest/internal/gtest-param-util-generated.h
-include/gtest/internal/gtest-param-util-generated.h.pump
 include/gtest/internal/gtest-param-util.h
 include/gtest/internal/gtest-port-arch.h
 include/gtest/internal/gtest-port.h
 include/gtest/internal/gtest-string.h
-include/gtest/internal/gtest-tuple.h
-include/gtest/internal/gtest-tuple.h.pump
 include/gtest/internal/gtest-type-util.h
-include/gtest/internal/gtest-type-util.h.pump
 lib/cmake/
 lib/cmake/GTest/
 lib/cmake/GTest/GTestConfig.cmake

--
Wbr, Andrew Krasavin

Reply via email to