bug 518641 - "make package-tests" doesn't work right on OS X universal builds. r=bsmedberg, a=beltzner
authorTed Mielczarek <ted.mielczarek@gmail.com>
Tue, 29 Sep 2009 08:31:50 -0400
changeset 33258 c0b78865c85eaa6b3e5582636cd7ea82d28e4b8b
parent 33257 7c46203384223f91056dd54a592219d5cdaa2633
child 33259 107a974f01aac96c25d03aa7538e4f266c080072
push id852
push usertmielczarek@mozilla.com
push dateWed, 02 Dec 2009 13:44:54 +0000
reviewersbsmedberg, beltzner
bugs518641
milestone1.9.2b5pre
bug 518641 - "make package-tests" doesn't work right on OS X universal builds. r=bsmedberg, a=beltzner This patch causes us to build archictecture-specific test packages in the OS X universal build postflight makefile, and unifies them into a universal test-package (containing the same test files, but universal binaries), and then special-cases the "package-tests" target to use that pre-generated test package in the universal build case. * * * Bug 518641 followup, delete unified test-package directory (resolves bustage the 2nd time a build slave packages tests) * * * bug 518641 followup, don't try to copy files around if the test-package directories don't exist.
Makefile.in
build/macosx/universal/flight.mk
testing/testsuite-targets.mk
--- a/Makefile.in
+++ b/Makefile.in
@@ -100,16 +100,19 @@ default alldep all::
 export::
 	$(RM) -rf $(DIST)/sdk
 	$(MAKE) -C config export
 	$(MAKE) tier_nspr
 
 ifdef ENABLE_TESTS
 # Additional makefile targets to call automated test suites
 include $(topsrcdir)/testing/testsuite-targets.mk
+else
+# OS X Universal builds will want to call this, so stub it out
+package-tests:
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 # After we build tier toolkit, go back and build the tools from previous dirs
 tier_toolkit::
 	$(MAKE) tools_tier_js
 	$(MAKE) tools_tier_xpcom
--- a/build/macosx/universal/flight.mk
+++ b/build/macosx/universal/flight.mk
@@ -107,8 +107,24 @@ postflight_all:
 	$(TOPSRCDIR)/build/macosx/universal/unify \
           --unify-with-sort "\.manifest$$" \
           --unify-with-sort "components\.list$$" \
 	  $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
 	  $(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
 	  $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
 # A universal .dmg can now be produced by making in either architecture's
 # INSTALLER_DIR.
+# Now, repeat the process for the test package.
+	$(MAKE) -C $(OBJDIR_PPC) UNIVERSAL_BINARY= package-tests
+	$(MAKE) -C $(OBJDIR_X86) UNIVERSAL_BINARY= package-tests
+	rm -rf $(DIST_UNI)/test-package-stage
+# automation.py differs because it hardcodes a path to
+# dist/bin. It doesn't matter which one we use.
+	if test -d $(DIST_PPC)/test-package-stage -a                 \
+                -d $(DIST_X86)/test-package-stage; then              \
+           cp $(DIST_PPC)/test-package-stage/mochitest/automation.py \
+             $(DIST_X86)/test-package-stage/mochitest/;              \
+           cp $(DIST_PPC)/test-package-stage/reftest/automation.py   \
+             $(DIST_X86)/test-package-stage/reftest/;                \
+           $(TOPSRCDIR)/build/macosx/universal/unify                 \
+             $(DIST_PPC)/test-package-stage                          \
+             $(DIST_X86)/test-package-stage                          \
+             $(DIST_UNI)/test-package-stage; fi
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -109,19 +109,25 @@ xpcshell-tests:
 	  --symbols-path=$(DIST)/crashreporter-symbols \
 	  $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) \
 	  $(DIST)/bin/xpcshell
 
 
 # Package up the tests and test harnesses
 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
 
+ifndef UNIVERSAL_BINARY
 PKG_STAGE = $(DIST)/test-package-stage
+package-tests: stage-mochitest stage-reftest stage-xpcshell
+else
+# This staging area has been built for us by universal/flight.mk
+PKG_STAGE = $(DIST)/universal/test-package-stage
+endif
 
-package-tests: stage-mochitest stage-reftest stage-xpcshell
+package-tests:
 	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
 	@(cd $(PKG_STAGE) && tar $(TAR_CREATE_FLAGS) - *) | bzip2 -f > "$(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
 
 stage-mochitest: make-stage-dir
 	$(MAKE) -C $(DEPTH)/testing/mochitest stage-package