Bug 1338559 - Add HAS_CHECK_RULE flag in moz.build; r?ted
MozReview-Commit-ID: 55auSfSC1Ry
--- a/build/win32/moz.build
+++ b/build/win32/moz.build
@@ -1,14 +1,16 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+HAS_CHECK_RULE = True
+
TEST_DIRS += ['crashinjectdll']
if CONFIG['ENABLE_TESTS']:
Program('crashinject')
SOURCES += [
'crashinject.cpp',
]
USE_STATIC_LIBS = True
--- a/config/moz.build
+++ b/config/moz.build
@@ -2,16 +2,18 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('**'):
BUG_COMPONENT = ('Core', 'Build Config')
+HAS_CHECK_RULE = True
+
DIST_INSTALL = False
# For sanity's sake, we compile nsinstall without the wrapped system
# headers, so that we can use it to set up the wrapped system headers.
NO_VISIBILITY_FLAGS = True
CONFIGURE_SUBST_FILES += [
'doxygen.cfg',
'makefiles/test/Makefile',
--- a/ipc/ipdl/test/cxx/moz.build
+++ b/ipc/ipdl/test/cxx/moz.build
@@ -1,14 +1,16 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+HAS_CHECK_RULE = True
+
DIRS += ['app']
EXPORTS.mozilla._ipdltest += [
'IPDLUnitTestProcessChild.h',
'IPDLUnitTests.h',
'IPDLUnitTestTypes.h',
'IPDLUnitTestUtils.h',
]
--- a/ipc/ipdl/test/ipdl/moz.build
+++ b/ipc/ipdl/test/ipdl/moz.build
@@ -1,6 +1,7 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+HAS_CHECK_RULE = True
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -6,16 +6,18 @@
# Directory metadata
component_engine = ('Core', 'JavaScript Engine')
component_gc = ('Core', 'JavaScript: GC')
component_intl = ('Core', 'JavaScript: Internationalization API')
component_jit = ('Core', 'JavaScript Engine: JIT')
component_stl = ('Core', 'JavaScript: Standard Library')
+HAS_CHECK_RULE = True
+
FILES_PER_UNIFIED_FILE = 6
with Files('../public/**'):
BUG_COMPONENT = component_engine
with Files('*'):
BUG_COMPONENT = component_engine
with Files('wasm/**'):
--- a/memory/replace/logalloc/replay/moz.build
+++ b/memory/replace/logalloc/replay/moz.build
@@ -1,14 +1,16 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+HAS_CHECK_RULE = True
+
Program('logalloc-replay')
SOURCES += [
'../FdPrintf.cpp',
'/mfbt/Assertions.cpp',
'Replay.cpp',
]
--- a/moz.build
+++ b/moz.build
@@ -3,16 +3,18 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files('**/Makefile.in'):
BUG_COMPONENT = ('Core', 'Build Config')
FINAL = True
+HAS_CHECK_RULE = True
+
FILES_PER_UNIFIED_FILE = 1
CONFIGURE_SUBST_FILES += [
'config/autoconf.mk',
'config/emptyvars.mk',
]
if CONFIG['ENABLE_CLANG_PLUGIN']:
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -412,16 +412,17 @@ class RecursiveMakeBackend(CommonBackend
self._traversal = RecursiveMakeTraversal()
self._compile_graph = OrderedDefaultDict(set)
self._no_skip = {
'export': set(),
'libs': set(),
'misc': set(),
'tools': set(),
+ 'check': set(),
}
def summary(self):
summary = super(RecursiveMakeBackend, self).summary()
summary.extend('; {makefile_in:d} -> {makefile_out:d} Makefile',
makefile_in=self._makefile_in_count,
makefile_out=self._makefile_out_count)
return summary
@@ -500,16 +501,19 @@ class RecursiveMakeBackend(CommonBackend
backend_file.write('%s += %s\n' % (
var, mozpath.relpath(f, backend_file.srcdir)))
elif isinstance(obj, VariablePassthru):
# Sorted so output is consistent and we don't bump mtimes.
for k, v in sorted(obj.variables.items()):
if k == 'HAS_MISC_RULE':
self._no_skip['misc'].add(backend_file.relobjdir)
continue
+ if k == 'HAS_CHECK_RULE':
+ self._no_skip['check'].add(backend_file.relobjdir)
+ continue
if isinstance(v, list):
for item in v:
backend_file.write(
'%s += %s\n' % (k, make_quote(shell_quote(item))))
elif isinstance(v, bool):
if v:
backend_file.write('%s := 1\n' % k)
else:
@@ -701,16 +705,17 @@ class RecursiveMakeBackend(CommonBackend
current = None
return current, [], subdirs.dirs + subdirs.tests
filters = [
('export', parallel_filter),
('libs', libs_filter),
('misc', parallel_filter),
('tools', tools_filter),
+ ('check', parallel_filter),
]
root_deps_mk = Makefile()
# Fill the dependencies for traversal of each tier.
for tier, filter in filters:
main, all_deps = \
self._traversal.compute_dependencies(filter)
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -1084,16 +1084,25 @@ VARIABLES = {
Presence of this variable indicates that this directory should be
traversed by the ``misc`` tier.
Please note that converting ``libs`` rules to the ``misc`` tier must
be done with care, as there are many implicit dependencies that can
break the build in subtle ways.
"""),
+ 'HAS_CHECK_RULE': (bool, bool,
+ """Whether this directory should be traversed during ``make check``.
+
+ In general, tests should be written in an appropriate test harness.
+ However, this tag can be used to indicate that this directory should run
+ tests using the old ``make check`` command.
+
+ """),
+
'FINAL_TARGET_FILES': (ContextDerivedTypedHierarchicalStringList(Path), list,
"""List of files to be installed into the application directory.
``FINAL_TARGET_FILES`` will copy (or symlink, if the platform supports it)
the contents of its files to the directory specified by
``FINAL_TARGET`` (typically ``dist/bin``). Files that are destined for a
subdirectory can be specified by accessing a field, or as a dict access.
For example, to export ``foo.png`` to the top-level directory and
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -901,16 +901,17 @@ class TreeMetadataEmitter(LoggingMixin):
'RESFILE',
'RCINCLUDE',
'DEFFILE',
'WIN32_EXE_LDFLAGS',
'LD_VERSION_SCRIPT',
'USE_EXTENSION_MANIFEST',
'NO_JS_MANIFEST',
'HAS_MISC_RULE',
+ 'HAS_CHECK_RULE',
]
for v in varlist:
if v in context and context[v]:
passthru.variables[v] = context[v]
if context.config.substs.get('OS_TARGET') == 'WINNT' and \
context['DELAYLOAD_DLLS']:
context['LDFLAGS'].extend([('-DELAYLOAD:%s' % dll)
--- a/toolkit/mozapps/update/tests/moz.build
+++ b/toolkit/mozapps/update/tests/moz.build
@@ -1,15 +1,16 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
HAS_MISC_RULE = True
+HAS_CHECK_RULE = True
FINAL_TARGET = '_tests/xpcshell/toolkit/mozapps/update/tests/data'
MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini']
XPCSHELL_TESTS_MANIFESTS += [
'unit_aus_update/xpcshell.ini',
'unit_base_updater/xpcshell.ini'
--- a/toolkit/xre/test/win/moz.build
+++ b/toolkit/xre/test/win/moz.build
@@ -1,14 +1,16 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+HAS_CHECK_RULE = True
+
SimplePrograms([
'TestXREMakeCommandLineWin',
])
CppUnitTests([
'TestDllInterceptor',
])