Bug 679460 - Improve |make mozmill-one| developer experience. Support both SOLO_FILE and SOLO_TEST but error out if both or neither are given, or if they're given with |make mozmill|. r=Standard8
authorSiddharth Agarwal <sid.bugzilla@gmail.com>
Wed, 07 Sep 2011 02:10:45 +0530
changeset 9111 e55763f24532fb98f1f80a9f12e67e6025b7a28b
parent 9110 84961292898a5dbd1599d498527501cc4f8ccc25
child 9112 2feb4188a1a256ff8a465b92f50c2209d56b2613
push id230
push userbugzilla@standard8.plus.com
push dateTue, 08 Nov 2011 22:55:24 +0000
treeherdercomm-beta@63dad5648415 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs679460
Bug 679460 - Improve |make mozmill-one| developer experience. Support both SOLO_FILE and SOLO_TEST but error out if both or neither are given, or if they're given with |make mozmill|. r=Standard8
mail/testsuite-targets.mk
--- a/mail/testsuite-targets.mk
+++ b/mail/testsuite-targets.mk
@@ -18,29 +18,34 @@ ifdef MOZ_DEBUG
 APP_NAME := $(APP_NAME)Debug
 endif
 PROGRAM = ../../../$(DIST)/$(APP_NAME).app/
 else
 # Non-mac options
 PROGRAM = ../../../$(DIST)/bin/thunderbird$(BIN_SUFFIX)
 endif
 
+check-no-solo = $(foreach solo,SOLO_TEST SOLO_FILE,$(if $($(solo)),$(error $(subst SOLOVAR,$(solo),$(1)))))
+find-solo-test = $(if $(and $(SOLO_TEST),$(SOLO_FILE)),$(error Both SOLO_TEST and SOLO_FILE are specified. You may only specify one.),$(if $(SOLO_TEST),$(SOLO_TEST),$(if $(SOLO_FILE),$(SOLO_FILE),$(error SOLO_TEST or SOLO_FILE needs to be specified.))))
+
 # PYTHONHOME messes very badly with virtualenv setups, so unset it.
-mozmill::
+mozmill:
+	$(call check-no-solo,SOLOVAR is specified. Perhaps you meant mozmill-one.)
 	unset PYTHONHOME && cd $(MOZMILLDIR) && MACOSX_DEPLOYMENT_TARGET= \
 	$(MOZMILLPYTHON) runtestlist.py --list=mozmilltests.list \
 	--binary=$(PROGRAM) \
 	--dir=$(call core_abspath,$(topsrcdir))/mail/test/mozmill \
 	--symbols-path=$(call core_abspath,$(DIST)/crashreporter-symbols) \
 	$(MOZMILL_EXTRA)
 
-mozmill-one::
+mozmill-one: solo-test = $(find-solo-test)
+mozmill-one:
 	unset PYTHONHOME && cd $(MOZMILLDIR) && MACOSX_DEPLOYMENT_TARGET= \
 	$(MOZMILLPYTHON) runtest.py \
-	--test=$(call core_abspath,$(topsrcdir))/mail/test/mozmill/$(SOLO_TEST) \
+	--test=$(call core_abspath,$(topsrcdir))/mail/test/mozmill/$(solo-test) \
 	--binary=$(PROGRAM) \
 	--symbols-path=$(call core_abspath,$(DIST)/crashreporter-symbols) \
 	$(MOZMILL_EXTRA)
 
 # 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