Permalink
Browse files

Bug 793928: Ship the Add-on SDK APIs as part of the platform. r=gps

  • Loading branch information...
Mossop committed Feb 1, 2013
1 parent fa914b8 commit 4ec7edb756ba1ebbdf35ac98d6ef92b011cae0e0
View
@@ -51,3 +51,6 @@ _OPT\.OBJ/
^python/psutil/.*\.so
^python/psutil/.*\.pyd
^python/psutil/build/
+
+# Git repositories
+.git/
View
@@ -0,0 +1,40 @@
+# 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/.
+
+DEPTH = @DEPTH@
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(topsrcdir)/config/config.mk
+
+TEST_DIRS += test
+
+COMMONJS_FILES = \
+ source/lib/toolkit \
+ source/lib/sdk \
+ $(NULL)
+
+COMMONJS_DEST = $(FINAL_TARGET)/modules/commonjs
+INSTALL_TARGETS += COMMONJS
+
+include $(topsrcdir)/config/rules.mk
+
+TEST_FILES = \
+ source/app-extension \
+ source/bin \
+ source/data \
+ source/python-lib \
+ source/test \
+ source/package.json \
+ source/mapping.json \
+ $(NULL)
+
+# Remove this once the test harness uses the APIs built into Firefox
+TEST_FILES += source/lib
+
+PKG_STAGE = $(DIST)/test-package-stage
+
+stage-tests-package:: $(TEST_FILES)
+ $(INSTALL) $^ $(PKG_STAGE)/jetpack
View
@@ -0,0 +1,37 @@
+# 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/.
+
+# Integrates the xpcshell test runner with mach.
+
+import os
+import sys
+
+from mozbuild.base import (
+ MachCommandBase,
+ MozbuildObject,
+)
+
+from mach.decorators import (
+ CommandArgument,
+ CommandProvider,
+ Command,
+)
+
+class JetpackRunner(MozbuildObject):
+ """Run jetpack tests."""
+ def run_tests(self, **kwargs):
+ self._run_make(target='jetpack-tests')
+
+@CommandProvider
+class MachCommands(MachCommandBase):
+ @Command('jetpack-test', help='Runs the jetpack test suite.')
+ def run_jetpack_test(self, **params):
+ # We should probably have a utility function to ensure the tree is
+ # ready to run tests. Until then, we just create the state dir (in
+ # case the tree wasn't built with mach).
+ self._ensure_state_subdir_exists('.')
+
+ jetpack = self._spawn(JetpackRunner)
+
+ jetpack.run_tests(**params)
View
1 mach
@@ -38,6 +38,7 @@ SEARCH_PATHS = [
# Individual files providing mach commands.
MACH_MODULES = [
+ 'addon-sdk/mach_commands.py',
'layout/tools/reftest/mach_commands.py',
'python/mozboot/mozboot/mach_commands.py',
'python/mozbuild/mozbuild/config.py',
@@ -344,6 +344,9 @@ cppunittests-remote:
echo "please prepare your host with environment variables for TEST_DEVICE"; \
fi
+jetpack-tests:
+ $(PYTHON) $(topsrcdir)/addon-sdk/source/bin/cfx -b $(browser_path) --parseable testpkgs
+
# Package up the tests and test harnesses
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
@@ -430,6 +433,7 @@ stage-android: make-stage-dir
stage-jetpack: make-stage-dir
$(NSINSTALL) $(topsrcdir)/testing/jetpack/jetpack-location.txt $(PKG_STAGE)/jetpack
+ $(MAKE) -C $(DEPTH)/addon-sdk stage-tests-package
stage-peptest: make-stage-dir
$(MAKE) -C $(DEPTH)/testing/peptest stage-package
@@ -138,6 +138,7 @@ skip-if = os == "win" || os == "mac" || os == "os2"
[include:netwerk/cookie/test/unit_ipc/xpcshell.ini]
[include:toolkit/components/contentprefs/tests/unit_ipc/xpcshell.ini]
[include:toolkit/addon-sdk/test/unit/xpcshell.ini]
+[include:addon-sdk/test/unit/xpcshell.ini]
[include:uriloader/exthandler/tests/unit_ipc/xpcshell.ini]
[include:modules/libmar/tests/unit/xpcshell.ini]
@@ -449,6 +449,7 @@ MAKEFILES_embedding="
"
MAKEFILES_xulapp="
+ addon-sdk/Makefile
toolkit/Makefile
toolkit/library/Makefile
toolkit/crashreporter/client/Makefile
@@ -719,6 +720,7 @@ fi
if [ "$ENABLE_TESTS" ]; then
add_makefiles "
+ addon-sdk/test/Makefile
caps/tests/mochitest/Makefile
chrome/test/Makefile
content/base/test/Makefile
View
@@ -310,6 +310,8 @@ tier_platform_dirs += toolkit/system/dbus
endif
endif
+tier_platform_dirs += addon-sdk
+
ifdef MOZ_MAPINFO
tier_platform_dirs += tools/codesighs
endif

0 comments on commit 4ec7edb

Please sign in to comment.