Author: arichardson Date: Mon Oct 19 19:50:57 2020 New Revision: 366850 URL: https://svnweb.freebsd.org/changeset/base/366850
Log: 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 Added: head/lib/googletest/tests/Makefile.inc (contents, props changed) head/lib/googletest/tests/gmock/ head/lib/googletest/tests/gmock/Makefile (contents, props changed) - copied, changed from r366849, head/lib/googletest/gmock/tests/Makefile head/lib/googletest/tests/gmock_main/ head/lib/googletest/tests/gmock_main/Makefile (contents, props changed) - copied, changed from r366849, head/lib/googletest/gmock_main/tests/Makefile head/lib/googletest/tests/gtest/ head/lib/googletest/tests/gtest/Makefile (contents, props changed) - copied, changed from r366849, head/lib/googletest/gtest/tests/Makefile head/lib/googletest/tests/gtest_main/ head/lib/googletest/tests/gtest_main/Makefile (contents, props changed) - copied, changed from r366849, head/lib/googletest/gtest_main/tests/Makefile Deleted: head/lib/googletest/gmock/tests/Makefile head/lib/googletest/gmock_main/tests/Makefile head/lib/googletest/gtest/tests/Makefile head/lib/googletest/gtest_main/tests/Makefile Modified: head/lib/googletest/gmock/Makefile head/lib/googletest/gmock_main/Makefile head/lib/googletest/gtest/Makefile head/lib/googletest/gtest_main/Makefile head/lib/googletest/tests/Makefile Modified: head/lib/googletest/gmock/Makefile ============================================================================== --- head/lib/googletest/gmock/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/gmock/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -42,7 +42,4 @@ INTERNAL_CUSTOM_INCS+= gmock/internal/custom/gmock-gen SRCS+= gmock-all.cc -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests - .include <bsd.lib.mk> Modified: head/lib/googletest/gmock_main/Makefile ============================================================================== --- head/lib/googletest/gmock_main/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/gmock_main/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -19,7 +19,4 @@ LDFLAGS+= -L${LIBGMOCKDIR} SRCS+= gmock_main.cc -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests - .include <bsd.lib.mk> Modified: head/lib/googletest/gtest/Makefile ============================================================================== --- head/lib/googletest/gtest/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/gtest/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -47,7 +47,4 @@ SRCS+= gtest-all.cc LIBADD+= pthread regex -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests - .include <bsd.lib.mk> Modified: head/lib/googletest/gtest_main/Makefile ============================================================================== --- head/lib/googletest/gtest_main/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/gtest_main/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -17,7 +17,4 @@ LDFLAGS+= -L${LIBGTESTDIR} SRCS+= gtest_main.cc -HAS_TESTS= -SUBDIR.${MK_TESTS}+= tests - .include <bsd.lib.mk> Modified: head/lib/googletest/tests/Makefile ============================================================================== --- head/lib/googletest/tests/Makefile Mon Oct 19 19:23:22 2020 (r366849) +++ head/lib/googletest/tests/Makefile Mon Oct 19 19:50:57 2020 (r366850) @@ -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> Added: head/lib/googletest/tests/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/googletest/tests/Makefile.inc Mon Oct 19 19:50:57 2020 (r366850) @@ -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} Copied and modified: head/lib/googletest/tests/gmock/Makefile (from r366849, head/lib/googletest/gmock/tests/Makefile) ============================================================================== Copied and modified: head/lib/googletest/tests/gmock_main/Makefile (from r366849, head/lib/googletest/gmock_main/tests/Makefile) ============================================================================== Copied and modified: head/lib/googletest/tests/gtest/Makefile (from r366849, head/lib/googletest/gtest/tests/Makefile) ============================================================================== Copied and modified: head/lib/googletest/tests/gtest_main/Makefile (from r366849, head/lib/googletest/gtest_main/tests/Makefile) ============================================================================== _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"