bug 518641 - "make package-tests" doesn't work right on OS X universal builds. r=bsmedberg
authorTed Mielczarek <ted.mielczarek@gmail.com>
Tue, 29 Sep 2009 08:31:50 -0400
changeset 33293 07837dc569c632cc49214aad902a0d7857082f0f
parent 33292 5642cd4a7e88fdc016fcd95248cc6109b60be1f8
child 33294 b2f29596aa4a21af733dcb56f5f66eb38b87c376
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs518641
milestone1.9.3a1pre
bug 518641 - "make package-tests" doesn't work right on OS X universal builds. r=bsmedberg 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.
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
@@ -105,8 +105,23 @@ postflight_all:
 	ln -s $(DIST_UNI) $(DIST_X86)/universal
 	rm -rf $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
 	$(TOPSRCDIR)/build/macosx/universal/unify \
 	  $(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
+# automation.py differs because it hardcodes a path to dist/bin.
+# It doesn't matter which one we use.
+	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/
+	if test -d $(DIST_PPC)/test-package-stage -a \
+                -d $(DIST_X86)/test-package-stage; then \
+           $(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
@@ -105,19 +105,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