Skip to content

Commit 89c245a

Browse files
committed
Bug 992983 - Build and upload the gtest libxul during test packaging. r=ted
--HG-- extra : commitid : EH7XMBkAkta
1 parent cadd5c5 commit 89c245a

File tree

6 files changed

+52
-29
lines changed

6 files changed

+52
-29
lines changed

build/gen_test_packages_manifest.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
'mozbase',
2020
'web-platform',
2121
'talos',
22+
'gtest',
2223
]
2324

2425
PACKAGE_SPECIFIED_HARNESSES = [
@@ -30,6 +31,11 @@
3031
'talos',
3132
]
3233

34+
# These packages are not present for every build configuration.
35+
OPTIONAL_PACKAGES = [
36+
'gtest',
37+
]
38+
3339

3440
def parse_args():
3541
parser = ArgumentParser(description='Generate a test_packages.json file to tell automation which harnesses require which test packages.')
@@ -46,6 +52,10 @@ def parse_args():
4652
parser.add_argument("--%s" % harness, required=True,
4753
action="store", dest=harness,
4854
help="Name of the %s zip." % harness)
55+
for harness in OPTIONAL_PACKAGES:
56+
parser.add_argument("--%s" % harness, required=False,
57+
action="store", dest=harness,
58+
help="Name of the %s zip." % harness)
4959
parser.add_argument("--dest-file", required=True,
5060
action="store", dest="destfile",
5161
help="Path to the output file to be written.")
@@ -66,8 +76,10 @@ def generate_package_data(args):
6676

6777
harness_requirements = dict([(k, [tests_common]) for k in ALL_HARNESSES])
6878
harness_requirements['jittest'].append(jsshell)
69-
for harness in PACKAGE_SPECIFIED_HARNESSES:
70-
pkg_name = getattr(args, harness)
79+
for harness in PACKAGE_SPECIFIED_HARNESSES + OPTIONAL_PACKAGES:
80+
pkg_name = getattr(args, harness, None)
81+
if pkg_name is None:
82+
continue
7183
if args.use_short_names:
7284
pkg_name = 'target.%s.tests.zip' % harness
7385
harness_requirements[harness].append(pkg_name)

python/mozbuild/mozbuild/action/test_archive.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
'pattern': '**',
3535
'ignore': [
3636
'cppunittest/**',
37+
'gtest/**',
3738
'mochitest/**',
3839
'reftest/**',
3940
'talos/**',
@@ -153,6 +154,13 @@
153154
'dest': 'cppunittest',
154155
},
155156
],
157+
'gtest': [
158+
{
159+
'source': STAGE,
160+
'base': '',
161+
'pattern': 'gtest/**',
162+
},
163+
],
156164
'mochitest': [
157165
{
158166
'source': buildconfig.topobjdir,

testing/gtest/Makefile.in

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,12 @@
77

88
include $(topsrcdir)/config/rules.mk
99

10-
# Bug 1028035: Linking xul-gtest.dll takes too long, so we disable GTest on
11-
# Windows PGO builds.
12-
ifeq (1_WINNT,$(MOZ_PGO)_$(OS_ARCH))
13-
SKIP_GTEST_DURING_MAKE_CHECK ?= 1
14-
endif
15-
1610
ifeq (browser,$(MOZ_BUILD_APP))
1711
ifdef COMPILE_ENVIRONMENT
1812
gtest::
1913
$(MAKE) -C $(DEPTH)/toolkit/library gtestxul
2014
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
2115
$(MAKE) -C $(DEPTH)/browser/app repackage
2216
endif
23-
ifneq (1,$(SKIP_GTEST_DURING_MAKE_CHECK))
24-
check::
25-
$(MAKE) -C $(DEPTH)/toolkit/library gtestxul
26-
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
27-
$(MAKE) -C $(DEPTH)/browser/app repackage
28-
$(PYTHON) $(topsrcdir)/testing/gtest/rungtests.py \
29-
--cwd=$(DEPTH)/_tests/gtest \
30-
--xre-path=$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources \
31-
--symbols-path=$(DIST)/crashreporter-symbols \
32-
$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(MOZ_APP_NAME)$(BIN_SUFFIX)
33-
else
34-
$(PYTHON) $(topsrcdir)/testing/gtest/rungtests.py \
35-
--cwd=$(DEPTH)/_tests/gtest \
36-
--xre-path=$(DIST)/bin \
37-
--symbols-path=$(DIST)/crashreporter-symbols \
38-
$(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX)
39-
endif
40-
else
41-
check::
42-
echo GTest skipped during make check
43-
endif
4417
endif
4518
endif

testing/testsuite-targets.mk

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ ifndef TEST_PACKAGE_NAME
2424
TEST_PACKAGE_NAME := $(ANDROID_PACKAGE_NAME)
2525
endif
2626

27+
# Linking xul-gtest.dll takes too long, so we disable GTest on
28+
# Windows PGO builds (bug 1028035).
29+
ifneq (1_WINNT,$(MOZ_PGO)_$(OS_ARCH))
30+
BUILD_GTEST=1
31+
endif
32+
33+
ifdef MOZ_B2G
34+
BUILD_GTEST=
35+
endif
36+
37+
ifeq ($(MOZ_BUILD_APP),mobile/android)
38+
BUILD_GTEST=
39+
endif
40+
2741
RUN_MOCHITEST_B2G_DESKTOP = \
2842
rm -f ./$@.log && \
2943
$(PYTHON) _tests/testing/mochitest/runtestsb2g.py \
@@ -399,6 +413,11 @@ TEST_PKGS := \
399413
xpcshell \
400414
$(NULL)
401415

416+
ifdef BUILD_GTEST
417+
stage-all: stage-gtest
418+
TEST_PKGS += gtest
419+
endif
420+
402421
PKG_ARG = --$(1) '$(PKG_BASENAME).$(1).tests.zip'
403422

404423
test-packages-manifest-tc:
@@ -482,6 +501,15 @@ stage-xpcshell: make-stage-dir
482501
stage-jstests: make-stage-dir
483502
$(MAKE) -C $(DEPTH)/js/src/tests stage-package
484503

504+
stage-gtest: make-stage-dir
505+
# FIXME: (bug 1200311) We should be generating the gtest xul as part of the build.
506+
$(MAKE) -C $(DEPTH)/testing/gtest gtest
507+
$(NSINSTALL) -D $(PKG_STAGE)/gtest/gtest_bin
508+
cp -RL $(DIST)/bin/gtest $(PKG_STAGE)/gtest/gtest_bin
509+
cp -RL $(DEPTH)/_tests/gtest $(PKG_STAGE)
510+
cp $(topsrcdir)/testing/gtest/rungtests.py $(PKG_STAGE)/gtest
511+
cp $(DIST)/bin/dependentlibs.list.gtest $(PKG_STAGE)/gtest
512+
485513
stage-android: make-stage-dir
486514
ifdef MOZ_ENABLE_SZIP
487515
# Tinderbox scripts are not unzipping everything, so the file needs to be in a directory it unzips

toolkit/mozapps/installer/package-name.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ MOCHITEST_PACKAGE = $(PKG_BASENAME).mochitest.tests.zip
143143
REFTEST_PACKAGE = $(PKG_BASENAME).reftest.tests.zip
144144
WP_TEST_PACKAGE = $(PKG_BASENAME).web-platform.tests.zip
145145
TALOS_PACKAGE = $(PKG_BASENAME).talos.tests.zip
146+
GTEST_PACKAGE = $(PKG_BASENAME).gtest.tests.zip
146147

147148
ifneq (,$(wildcard $(DIST)/bin/application.ini))
148149
BUILDID = $(shell $(PYTHON) $(MOZILLA_DIR)/config/printconfigsetting.py $(DIST)/bin/application.ini App BuildID)

toolkit/mozapps/installer/upload-files.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ UPLOAD_FILES= \
743743
$(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(TALOS_PACKAGE)) \
744744
$(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(REFTEST_PACKAGE)) \
745745
$(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(WP_TEST_PACKAGE)) \
746+
$(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(GTEST_PACKAGE)) \
746747
$(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip) \
747748
$(call QUOTED_WILDCARD,$(DIST)/$(SDK)) \
748749
$(call QUOTED_WILDCARD,$(MOZ_SOURCESTAMP_FILE)) \

0 commit comments

Comments
 (0)