Major improvement to build parallelism for googletest internal tests

Currently the googletest internal tests build after the matching library.
However, each of these is serialized at the top level makefile.
Additionally some of the tests (e.g. the gmock-matches-test) take up to
90 seconds to build with clang -O2. Having to wait for this test to
complete before continuing to the next directory seriously slows down the
parllelism of a -j32 build.
Before this change running `make -C lib/googletest -j32 -s` in buildenv
took 202 seconds, now it's 153 due to improved parallelism.

Reviewed By:	emaste (no objection)
Differential Revision: https://reviews.freebsd.org/D26748
This commit is contained in:
Alex Richardson 2020-10-19 19:50:57 +00:00
parent 6b56b0ca93
commit 2ed3236082
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=366850
10 changed files with 12 additions and 12 deletions

View File

@ -42,7 +42,4 @@ INTERNAL_CUSTOM_INCS+= gmock/internal/custom/gmock-generated-actions.h
SRCS+= gmock-all.cc
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
.include <bsd.lib.mk>

View File

@ -19,7 +19,4 @@ LDFLAGS+= -L${LIBGMOCKDIR}
SRCS+= gmock_main.cc
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
.include <bsd.lib.mk>

View File

@ -47,7 +47,4 @@ SRCS+= gtest-all.cc
LIBADD+= pthread regex
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
.include <bsd.lib.mk>

View File

@ -17,7 +17,4 @@ LDFLAGS+= -L${LIBGTESTDIR}
SRCS+= gtest_main.cc
HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests
.include <bsd.lib.mk>

View File

@ -3,4 +3,10 @@
.PATH: ${SRCTOP}/tests
KYUAFILE= yes
# Note: we start the gmock_main and gmock tests first since those take up to
# 60 seconds to build, so starting them late seriously reduces build parallism.
SUBDIR= gmock_main gmock gtest_main gtest
SUBDIR_PARALLEL=
.include <bsd.test.mk>

View File

@ -0,0 +1,6 @@
# $FreeBSD$
.include "../Makefile.inc"
# Keep the existing tests directory structure (with subdirs per component)
# rather than installing all of them to /usr/tests/lib/googletest
TESTSDIR= ${TESTSBASE}/lib/googletest/${.CURDIR:T}