Bug 1200311 - Build the gtest libxul during the compile tier instead of package-tests. r=ted

MozReview-Commit-ID: HX2ORY8cUV9

--HG--
extra : rebase_source : a5510ea1709313206bd620815f7283832fe3efee
This commit is contained in:
Chris Manchester 2017-02-06 14:34:07 -08:00
parent eb8151510d
commit b3946b997e
4 changed files with 16 additions and 21 deletions

View File

@ -157,6 +157,17 @@ def build_backends(backends):
set_config('BUILD_BACKENDS', build_backends)
# Determine whether to build the gtest xul. This happens in automation
# on Desktop platforms with the exception of Windows PGO, where linking
# xul-gtest.dll takes too long.
@depends('MOZ_PGO', build_project, target, 'MOZ_AUTOMATION',
when='--enable-compile-environment')
def build_gtest(pgo, build_project, target, automation):
if (automation and build_project == 'browser' and
not (pgo and target.os == 'WINNT')):
return True
set_config('LINK_GTEST_DURING_COMPILE', build_gtest)
# Awk detection
# ==============================================================

View File

@ -12,20 +12,6 @@ ifndef TEST_PACKAGE_NAME
TEST_PACKAGE_NAME := $(ANDROID_PACKAGE_NAME)
endif
# Linking xul-gtest.dll takes too long, so we disable GTest on
# Windows PGO builds (bug 1028035).
ifneq (1_WINNT,$(MOZ_PGO)_$(OS_ARCH))
BUILD_GTEST=1
endif
ifneq (browser,$(MOZ_BUILD_APP))
BUILD_GTEST=
endif
ifndef COMPILE_ENVIRONMENT
BUILD_GTEST=
endif
ifndef NO_FAIL_ON_TEST_ERRORS
define check_test_error_internal
@errors=`grep 'TEST-UNEXPECTED-' $@.log` ;\
@ -152,7 +138,7 @@ TEST_PKGS := \
xpcshell \
$(NULL)
ifdef BUILD_GTEST
ifdef LINK_GTEST_DURING_COMPILE
stage-all: stage-gtest
TEST_PKGS += gtest
endif
@ -218,8 +204,6 @@ stage-jstests: make-stage-dir
$(MAKE) -C $(DEPTH)/js/src/tests stage-package
stage-gtest: make-stage-dir
# FIXME: (bug 1200311) We should be generating the gtest xul as part of the build.
$(MAKE) -C $(DEPTH)/testing/gtest gtest
$(NSINSTALL) -D $(PKG_STAGE)/gtest/gtest_bin
cp -RL $(DIST)/bin/gtest $(PKG_STAGE)/gtest/gtest_bin
cp -RL $(DEPTH)/_tests/gtest $(PKG_STAGE)

View File

@ -14,4 +14,4 @@ include $(topsrcdir)/config/rules.mk
.PHONY: gtestxul
gtestxul:
$(MAKE) -C $(DEPTH) toolkit/library/gtest/target LINK_GTEST=1
$(MAKE) -C $(DEPTH) toolkit/library/gtest/target LINK_GTEST_DURING_COMPILE=1

View File

@ -5,11 +5,11 @@
# Enforce that the clean/distclean rules removes everything that needs
# to be removed from this directory.
ifneq (,$(filter clean distclean,$(MAKECMDGOALS)))
LINK_GTEST = 1
LINK_GTEST_DURING_COMPILE = 1
endif
ifndef LINK_GTEST
# Force to not include backend.mk unless LINK_GTEST is defined.
ifndef LINK_GTEST_DURING_COMPILE
# Force to not include backend.mk unless LINK_GTEST_DURING_COMPILE is set.
# Not including backend.mk makes traversing this directory do nothing.
STANDALONE_MAKEFILE = 1