Bug 1044657 - Move PYTHON_UNIT_TESTS to moz.build; r=mshal
authorMs2ger <ms2ger@gmail.com>
Mon, 28 Jul 2014 17:51:12 +0200
changeset 219301 56f392ebff92b607f6e5a260cb59c37f95a70df2
parent 219300 3e3eda7131a7f720bca99692c605096a5d854ca4
child 219302 1c99a02fcaca3e58db85746689b8506d03588f92
push id583
push userbhearsum@mozilla.com
push dateMon, 24 Nov 2014 19:04:58 +0000
treeherdermozilla-release@c107e74250f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1044657
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1044657 - Move PYTHON_UNIT_TESTS to moz.build; r=mshal As a first step, this moves PYTHON_UNIT_TESTS to moz.build as a passthru variable. In the future, we could hook it up to |mach test|. The __init__.py files may not need to be in the list, but I don't want to change the list here.
browser/Makefile.in
build/moz.build
config/Makefile.in
config/config.mk
config/moz.build
dom/bindings/Makefile.in
dom/bindings/moz.build
python/Makefile.in
python/moz.build
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/frontend/sandbox_symbols.py
testing/mozbase/Makefile.in
testing/mozbase/moz.build
testing/xpcshell/Makefile.in
testing/xpcshell/moz.build
xpcom/typelib/xpt/tools/Makefile.in
xpcom/typelib/xpt/tools/moz.build
--- a/browser/Makefile.in
+++ b/browser/Makefile.in
@@ -9,11 +9,8 @@ ifdef MAKENSISU
 # For Windows build the uninstaller during the application build since the
 # uninstaller is included with the application for mar file generation.
 libs::
 	$(MAKE) -C installer/windows uninstaller
 ifdef MOZ_MAINTENANCE_SERVICE
 	$(MAKE) -C installer/windows maintenanceservice_installer
 endif
 endif
-
-check::
-	$(PYTHON) $(topsrcdir)/build/compare-mozconfig/compare-mozconfigs-wrapper.py
--- a/build/moz.build
+++ b/build/moz.build
@@ -39,8 +39,12 @@ if CONFIG['MOZ_BUILD_APP'] == 'browser':
 if CONFIG['MOZ_APP_PROFILE']:
     DEFINES['MOZ_APP_PROFILE'] = CONFIG['MOZ_APP_PROFILE']
 
 for var in ('MOZ_CRASHREPORTER', 'MOZ_PROFILE_MIGRATOR',
             'MOZ_EXTENSION_MANAGER', 'MOZ_APP_STATIC_INI'):
     if CONFIG[var]:
         DEFINES[var] = True
 
+if CONFIG['MOZ_BUILD_APP'] == 'browser':
+    PYTHON_UNIT_TESTS += [
+        'compare-mozconfig/compare-mozconfigs-wrapper.py',
+    ]
--- a/config/Makefile.in
+++ b/config/Makefile.in
@@ -34,18 +34,16 @@ ifndef JS_STANDALONE
 HEADERS_FILES = \
 	$(DEPTH)/mozilla-config.h \
 	$(NULL)
 HEADERS_DEST := $(DIST)/include
 HEADERS_TARGET := export
 INSTALL_TARGETS += HEADERS
 endif
 
-PYTHON_UNIT_TESTS := $(wildcard $(srcdir)/tests/unit-*.py)
-
 include $(topsrcdir)/config/rules.mk
 
 HOST_CFLAGS += -DUNICODE -D_UNICODE
 
 ifndef JS_STANDALONE
 # Generate a new buildid every time we "export" in config... that's only
 # supposed to be once per-build!
 export::
--- a/config/config.mk
+++ b/config/config.mk
@@ -60,16 +60,17 @@ endif
   LIBRARY_NAME \
   LIBS \
   MAKE_FRAMEWORK \
   MODULE \
   MSVC_ENABLE_PGO \
   NO_DIST_INSTALL \
   PARALLEL_DIRS \
   PROGRAM \
+  PYTHON_UNIT_TESTS \
   RESOURCE_FILES \
   SDK_HEADERS \
   SDK_LIBRARY \
   SHARED_LIBRARY_LIBS \
   SHARED_LIBRARY_NAME \
   SIMPLE_PROGRAMS \
   SONAME \
   STATIC_LIBRARY_NAME \
--- a/config/moz.build
+++ b/config/moz.build
@@ -23,8 +23,15 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
     ]
     HOST_PROGRAM = 'nsinstall_real'
 
 if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
     DEFINES['GKMEDIAS_SHARED_LIBRARY'] = True
 
 if CONFIG['MOZ_SHARED_ICU']:
     DEFINES['MOZ_SHARED_ICU'] = True
+
+PYTHON_UNIT_TESTS += [
+    'tests/unit-expandlibs.py',
+    'tests/unit-mozunit.py',
+    'tests/unit-nsinstall.py',
+    'tests/unit-printprereleasesuffix.py',
+]
--- a/dom/bindings/Makefile.in
+++ b/dom/bindings/Makefile.in
@@ -19,18 +19,16 @@ CPPSRCS += $(globalgen_sources) $(unifie
 # Generated bindings reference *Binding.h, not mozilla/dom/*Binding.h. And,
 # since we generate exported bindings directly to $(DIST)/include, we need
 # to add that path to the search list.
 #
 # Ideally, binding generation uses the prefixed header file names.
 # Bug 932092 tracks.
 LOCAL_INCLUDES += -I$(DIST)/include/mozilla/dom
 
-PYTHON_UNIT_TESTS += $(srcdir)/mozwebidlcodegen/test/test_mozwebidlcodegen.py
-
 include $(topsrcdir)/config/rules.mk
 
 # TODO This list should be emitted to a .pp file via
 # GenerateCSS2PropertiesWebIDL.py.
 css2properties_dependencies = \
   $(topsrcdir)/layout/style/nsCSSPropList.h \
   $(topsrcdir)/layout/style/nsCSSPropAliasList.h \
   $(webidl_base)/CSS2Properties.webidl.in \
--- a/dom/bindings/moz.build
+++ b/dom/bindings/moz.build
@@ -91,8 +91,12 @@ if CONFIG['MOZ_AUDIO_CHANNEL_MANAGER']:
 FINAL_LIBRARY = 'xul'
 
 SPHINX_TREES['webidl'] = 'docs'
 SPHINX_PYTHON_PACKAGE_DIRS += ['mozwebidlcodegen']
 
 if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
     # This is needed for Window.webidl
     DEFINES['HAVE_SIDEBAR'] = True
+
+PYTHON_UNIT_TESTS += [
+    'mozwebidlcodegen/test/test_mozwebidlcodegen.py',
+]
deleted file mode 100644
--- a/python/Makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# 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/.
-
-test_dirs := \
-  mach/mach/test \
-  mozbuild/mozbuild/test \
-  mozbuild/mozbuild/test/action \
-  mozbuild/mozbuild/test/backend \
-  mozbuild/mozbuild/test/controller \
-  mozbuild/mozbuild/test/compilation \
-  mozbuild/mozbuild/test/frontend \
-  mozbuild/mozpack/test \
-  mozbuild/dumbmake/test \
-  $(NULL)
-
-PYTHON_UNIT_TESTS := $(foreach dir,$(test_dirs),$(wildcard $(srcdir)/$(dir)/*.py))
--- a/python/moz.build
+++ b/python/moz.build
@@ -5,8 +5,65 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 SPHINX_PYTHON_PACKAGE_DIRS += [
     'codegen',
     'mozbuild/mozbuild',
     'mozbuild/mozpack',
     'mozversioncontrol/mozversioncontrol',
 ]
+
+PYTHON_UNIT_TESTS += [
+    'mach/mach/test/__init__.py',
+    'mach/mach/test/common.py',
+    'mach/mach/test/test_conditions.py',
+    'mach/mach/test/test_config.py',
+    'mach/mach/test/test_entry_point.py',
+    'mach/mach/test/test_error_output.py',
+    'mach/mach/test/test_logger.py',
+    'mozbuild/dumbmake/test/__init__.py',
+    'mozbuild/dumbmake/test/test_dumbmake.py',
+    'mozbuild/mozbuild/test/__init__.py',
+    'mozbuild/mozbuild/test/action/test_buildlist.py',
+    'mozbuild/mozbuild/test/backend/__init__.py',
+    'mozbuild/mozbuild/test/backend/common.py',
+    'mozbuild/mozbuild/test/backend/test_android_eclipse.py',
+    'mozbuild/mozbuild/test/backend/test_configenvironment.py',
+    'mozbuild/mozbuild/test/backend/test_recursivemake.py',
+    'mozbuild/mozbuild/test/backend/test_visualstudio.py',
+    'mozbuild/mozbuild/test/common.py',
+    'mozbuild/mozbuild/test/compilation/__init__.py',
+    'mozbuild/mozbuild/test/compilation/test_warnings.py',
+    'mozbuild/mozbuild/test/controller/__init__.py',
+    'mozbuild/mozbuild/test/controller/test_clobber.py',
+    'mozbuild/mozbuild/test/frontend/__init__.py',
+    'mozbuild/mozbuild/test/frontend/test_emitter.py',
+    'mozbuild/mozbuild/test/frontend/test_namespaces.py',
+    'mozbuild/mozbuild/test/frontend/test_reader.py',
+    'mozbuild/mozbuild/test/frontend/test_sandbox.py',
+    'mozbuild/mozbuild/test/frontend/test_sandbox_symbols.py',
+    'mozbuild/mozbuild/test/test_base.py',
+    'mozbuild/mozbuild/test/test_containers.py',
+    'mozbuild/mozbuild/test/test_expression.py',
+    'mozbuild/mozbuild/test/test_jarmaker.py',
+    'mozbuild/mozbuild/test/test_line_endings.py',
+    'mozbuild/mozbuild/test/test_link_deps.py',
+    'mozbuild/mozbuild/test/test_makeutil.py',
+    'mozbuild/mozbuild/test/test_mozconfig.py',
+    'mozbuild/mozbuild/test/test_mozinfo.py',
+    'mozbuild/mozbuild/test/test_preprocessor.py',
+    'mozbuild/mozbuild/test/test_pythonutil.py',
+    'mozbuild/mozbuild/test/test_testing.py',
+    'mozbuild/mozbuild/test/test_util.py',
+    'mozbuild/mozpack/test/__init__.py',
+    'mozbuild/mozpack/test/test_chrome_flags.py',
+    'mozbuild/mozpack/test/test_chrome_manifest.py',
+    'mozbuild/mozpack/test/test_copier.py',
+    'mozbuild/mozpack/test/test_errors.py',
+    'mozbuild/mozpack/test/test_files.py',
+    'mozbuild/mozpack/test/test_manifests.py',
+    'mozbuild/mozpack/test/test_mozjar.py',
+    'mozbuild/mozpack/test/test_packager.py',
+    'mozbuild/mozpack/test/test_packager_formats.py',
+    'mozbuild/mozpack/test/test_packager_l10n.py',
+    'mozbuild/mozpack/test/test_path.py',
+    'mozbuild/mozpack/test/test_unify.py',
+]
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -380,16 +380,17 @@ class TreeMetadataEmitter(LoggingMixin):
             'FILES_PER_UNIFIED_FILE',
             'USE_STATIC_LIBS',
             'GENERATED_FILES',
             'IS_GYP_DIR',
             'JS_MODULES_PATH',
             'MSVC_ENABLE_PGO',
             'NO_DIST_INSTALL',
             'OS_LIBS',
+            'PYTHON_UNIT_TESTS',
             'RCFILE',
             'RESFILE',
             'RCINCLUDE',
             'DEFFILE',
             'WIN32_EXE_LDFLAGS',
             'LD_VERSION_SCRIPT',
         ]
         for v in varlist:
--- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
@@ -284,16 +284,20 @@ VARIABLES = {
         """A parallel version of ``DIRS``.
 
         Ideally this variable does not exist. It is provided so a transition
         from recursive makefiles can be made. Once the build system has been
         converted to not use Makefile's for the build frontend, this will
         likely go away.
         """, None),
 
+    'PYTHON_UNIT_TESTS': (StrictOrderingOnAppendList, list,
+        """A list of python unit tests.
+        """, None),
+
     'HOST_LIBRARY_NAME': (unicode, unicode,
         """Name of target library generated when cross compiling.
         """, 'binaries'),
 
     'JAVA_JAR_TARGETS': (dict, dict,
         """Defines Java JAR targets to be built.
 
         This variable should not be populated directly. Instead, it should
--- a/testing/mozbase/Makefile.in
+++ b/testing/mozbase/Makefile.in
@@ -1,16 +1,12 @@
 # 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/.
 
-PYTHON_UNIT_TESTS := \
-  test.py \
-  $(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 # Harness packages from the srcdir
 MOZBASE_PACKAGES = \
   manifestparser \
   mozcrash \
   mozfile \
   mozhttpd \
--- a/testing/mozbase/moz.build
+++ b/testing/mozbase/moz.build
@@ -1,6 +1,9 @@
 # -*- Mode: python; c-basic-offset: 4; 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/.
 
+PYTHON_UNIT_TESTS += [
+    'test.py',
+]
--- a/testing/xpcshell/Makefile.in
+++ b/testing/xpcshell/Makefile.in
@@ -1,18 +1,13 @@
 #
 # 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/.
 
-# Run selftests
-PYTHON_UNIT_TESTS := \
-  selftest.py
-  $(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 # Harness files from the srcdir
 TEST_HARNESS_FILES := \
   runxpcshelltests.py \
   remotexpcshelltests.py \
   runtestsb2g.py \
   head.js \
--- a/testing/xpcshell/moz.build
+++ b/testing/xpcshell/moz.build
@@ -1,8 +1,11 @@
 # -*- Mode: python; c-basic-offset: 4; 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/.
 
 TEST_DIRS += ['example']
 
+PYTHON_UNIT_TESTS += [
+    'selftest.py',
+]
--- a/xpcom/typelib/xpt/tools/Makefile.in
+++ b/xpcom/typelib/xpt/tools/Makefile.in
@@ -6,10 +6,8 @@
 INTERNAL_TOOLS	= 1
 
 XPT_TOOL_FILES := xpt.py
 # SDK_BIN_DIR is declared in config.mk, so this needs to be a deferred
 # assignment.
 XPT_TOOL_DEST = $(SDK_BIN_DIR)
 XPT_TOOL_TARGET := export
 INSTALL_TARGETS += XPT_TOOL
-
-PYTHON_UNIT_TESTS := runtests.py
--- a/xpcom/typelib/xpt/tools/moz.build
+++ b/xpcom/typelib/xpt/tools/moz.build
@@ -1,6 +1,9 @@
 # -*- Mode: python; c-basic-offset: 4; 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/.
 
+PYTHON_UNIT_TESTS += [
+    'runtests.py',
+]