Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1044657 - Move PYTHON_UNIT_TESTS to moz.build; r=mshal
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ms2ger committed Jul 28, 2014
1 parent d267705 commit 33bed37
Show file tree
Hide file tree
Showing 17 changed files with 87 additions and 35 deletions.
3 changes: 0 additions & 3 deletions browser/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ ifdef MOZ_MAINTENANCE_SERVICE
$(MAKE) -C installer/windows maintenanceservice_installer
endif
endif

check::
$(PYTHON) $(topsrcdir)/build/compare-mozconfig/compare-mozconfigs-wrapper.py
4 changes: 4 additions & 0 deletions build/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ for var in ('MOZ_CRASHREPORTER', 'MOZ_PROFILE_MIGRATOR',
if CONFIG[var]:
DEFINES[var] = True

if CONFIG['MOZ_BUILD_APP'] == 'browser':
PYTHON_UNIT_TESTS += [
'compare-mozconfig/compare-mozconfigs-wrapper.py',
]
2 changes: 0 additions & 2 deletions config/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ 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
Expand Down
1 change: 1 addition & 0 deletions config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ _MOZBUILD_EXTERNAL_VARIABLES := \
NO_DIST_INSTALL \
PARALLEL_DIRS \
PROGRAM \
PYTHON_UNIT_TESTS \
RESOURCE_FILES \
SDK_HEADERS \
SDK_LIBRARY \
Expand Down
7 changes: 7 additions & 0 deletions config/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ if CONFIG['GKMEDIAS_SHARED_LIBRARY']:

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',
]
2 changes: 0 additions & 2 deletions dom/bindings/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ CPPSRCS += $(globalgen_sources) $(unified_binding_cpp_files)
# 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
Expand Down
4 changes: 4 additions & 0 deletions dom/bindings/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,7 @@ 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',
]
17 changes: 0 additions & 17 deletions python/Makefile.in

This file was deleted.

57 changes: 57 additions & 0 deletions python/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,60 @@ SPHINX_PYTHON_PACKAGE_DIRS += [
'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',
]
1 change: 1 addition & 0 deletions python/mozbuild/mozbuild/frontend/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def emit_from_sandbox(self, sandbox):
'MSVC_ENABLE_PGO',
'NO_DIST_INSTALL',
'OS_LIBS',
'PYTHON_UNIT_TESTS',
'RCFILE',
'RESFILE',
'RCINCLUDE',
Expand Down
4 changes: 4 additions & 0 deletions python/mozbuild/mozbuild/frontend/sandbox_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ def __new__(cls, sandbox, value=""):
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'),
Expand Down
4 changes: 0 additions & 4 deletions testing/mozbase/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
# 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
Expand Down
3 changes: 3 additions & 0 deletions testing/mozbase/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# 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',
]
5 changes: 0 additions & 5 deletions testing/xpcshell/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
# 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
Expand Down
3 changes: 3 additions & 0 deletions testing/xpcshell/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@

TEST_DIRS += ['example']

PYTHON_UNIT_TESTS += [
'selftest.py',
]
2 changes: 0 additions & 2 deletions xpcom/typelib/xpt/tools/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ XPT_TOOL_FILES := xpt.py
XPT_TOOL_DEST = $(SDK_BIN_DIR)
XPT_TOOL_TARGET := export
INSTALL_TARGETS += XPT_TOOL

PYTHON_UNIT_TESTS := runtests.py
3 changes: 3 additions & 0 deletions xpcom/typelib/xpt/tools/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
# 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',
]

0 comments on commit 33bed37

Please sign in to comment.