Bug 599305 - Make package-tests should package xpcshell-tests as well; r=gozer
authorMark Banner <bugzilla@standard8.plus.com>
Mon, 27 Sep 2010 11:20:47 +0100
changeset 6436 97f4ad3b49f712d1d5a9466775c391d265d0958f
parent 6435 f4a93ad5efb50d350a875c94f1dfdfe8a9fcbec2
child 6437 d9d42538b0197de5e3aff70acc4308eff0cf3177
push idunknown
push userunknown
push dateunknown
reviewersgozer
bugs599305
Bug 599305 - Make package-tests should package xpcshell-tests as well; r=gozer
mail/testsuite-targets.mk
--- a/mail/testsuite-targets.mk
+++ b/mail/testsuite-targets.mk
@@ -26,33 +26,44 @@ mozmill::
 
 mozmill-one::
 	cd $(MOZMILLDIR) && MACOSX_DEPLOYMENT_TARGET= $(PYTHON) runtest.py \
 	--test=$(call core_abspath,$(topsrcdir))/mail/test/mozmill/$(SOLO_TEST) \
 	--binary=$(PROGRAM) \
 	--symbols-path=$(call core_abspath,$(DIST)/crashreporter-symbols) \
 	$(MOZMILL_EXTRA)
 
-# XXX Really we should be re-using the mozilla-central
-# testing/testsuite-targets.mk. However, to get mozmill tests packaged and
-# running, we've just implemented what we need here for now.
+# XXX The mozilla/testing/testsuite-targets.mk doesn't really allow for hooks
+# outside of itself. Therefore we replicate the functionality we need here,
+# calling into the relevant mozilla dirs when necessary for the core tests.
 ifndef UNIVERSAL_BINARY
 PKG_STAGE = $(DIST)/test-package-stage
-package-tests:: stage-mozmill
+package-tests:: stage-mozilla-tests stage-mozmill
 else
 # This staging area has been built for us by universal/flight.mk
 PKG_STAGE = $(DIST)/universal/test-package-stage
 endif
 
 package-tests::
 	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
 	@rm -f "$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)"
 	cd $(PKG_STAGE) && \
 	  zip -r9D "$(call core_abspath,$(DIST)/$(PKG_PATH)$(TEST_PACKAGE))" *
 
 make-stage-dir:
 	rm -rf $(PKG_STAGE) && $(NSINSTALL) -D $(PKG_STAGE) && $(NSINSTALL) -D $(PKG_STAGE)/bin && $(NSINSTALL) -D $(PKG_STAGE)/bin/components && $(NSINSTALL) -D $(PKG_STAGE)/certs
 
+# Of the core tests, we only currently support xpcshell. Unfortunately
+# some of the required xpcshell bits are packaged by mochitest, so we have to
+# package those as well.
+stage-mozilla-tests: make-stage-dir
+	$(MAKE) -C $(DEPTH)/mozilla/testing/mochitest stage-package
+	$(MAKE) -C $(DEPTH)/mozilla/testing/xpcshell stage-package
+
+# Although we should probably depend on make-stage-dir here, we don't as the
+# make-stage-dir actually removes the package directory for us. Given that we
+# are running stage-mozilla-tests which calls testing/testsuite-targets.mk which
+# does do this for some tests, then we're actually fine.
 stage-mozmill: make-stage-dir
 	$(MAKE) -C $(DEPTH)/mail/test/mozmill stage-package
 
 .PHONY: \
   package-tests make-stage-dir stage-mozmill