Bug 482768 - xpcshell tests broken on trunk due to mozilla-central changes; (Av1) Support both shell/1.9.1 and python/1.9.2; r=bugzilla@standard8.plus.com
authorSerge Gautherie <sgautherie.bz@free.fr>
Fri, 13 Mar 2009 13:08:08 +0100
changeset 2205 bd9dc914d9354450741fdeff236105b8e6d18a6f
parent 2204 4964819a0618e89e9d074299409742168bc5f7e4
child 2206 b7731c0b184955cba3a91a5555245fef0339ad70
push idunknown
push userunknown
push dateunknown
reviewersbugzilla
bugs482768
Bug 482768 - xpcshell tests broken on trunk due to mozilla-central changes; (Av1) Support both shell/1.9.1 and python/1.9.2; r=bugzilla@standard8.plus.com
config/rules.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -122,16 +122,18 @@ ifdef ENABLE_TESTS
 ifdef XPCSHELL_TESTS
 ifndef MODULE
 $(error Must define MODULE when defining XPCSHELL_TESTS.)
 endif
 
 testxpcobjdir = $(MOZDEPTH)/_tests/xpcshell
 
 # Test file installation
+ifdef MOZILLA_1_9_1_BRANCH
+
 libs::
 	@$(EXIT_ON_ERROR) \
 	for testdir in $(XPCSHELL_TESTS); do \
 	  $(INSTALL) \
 	    $(srcdir)/$$testdir/*.js \
 	    $(testxpcobjdir)/$(MODULE)/$$testdir; \
 	done
 
@@ -186,16 +188,61 @@ check-one::
 	$(RUN_TEST_PROGRAM) \
 	  $(testxpcsrcdir)/test_one.sh \
 	    $(DIST)/bin/xpcshell \
 	    $(FWDSLASH_TOPSRCDIR) \
 	    $(NATIVE_TOPSRCDIR) \
 	    $(testxpcobjdir)/$(MODULE)/$$testdir \
 	    $(SOLO_FILE) 0;
 
+else # MOZILLA_1_9_1_BRANCH
+
+define _INSTALL_TESTS
+$(INSTALL) $(wildcard $(srcdir)/$(dir)/*.js) $(testxpcobjdir)/$(MODULE)/$(dir)
+
+endef # do not remove the blank line!
+
+SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
+
+libs::
+	$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
+
+testxpcsrcdir = $(MOZILLA_SRCDIR)/testing/xpcshell
+
+# Execute all tests in the $(XPCSHELL_TESTS) directories.
+check::
+	$(PYTHON) \
+          $(testxpcsrcdir)/runxpcshelltests.py \
+          $(DIST)/bin/xpcshell \
+          $(MOZILLA_SRCDIR) \
+          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
+
+# Execute a single test, specified in $(SOLO_FILE), but don't automatically
+# start the test. Instead, present the xpcshell prompt so the user can
+# attach a debugger and then start the test.
+check-interactive::
+	$(PYTHON) \
+          $(testxpcsrcdir)/runxpcshelltests.py \
+          --test=$(SOLO_FILE) \
+          --interactive \
+          $(DIST)/bin/xpcshell \
+          $(MOZILLA_SRCDIR) \
+          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
+
+# Execute a single test, specified in $(SOLO_FILE)
+check-one::
+	$(PYTHON) \
+          $(testxpcsrcdir)/runxpcshelltests.py \
+          --test=$(SOLO_FILE) \
+          $(DIST)/bin/xpcshell \
+          $(MOZILLA_SRCDIR) \
+          $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
+
+endif # MOZILLA_1_9_1_BRANCH
+
 endif # XPCSHELL_TESTS
 
 ifdef CPP_UNIT_TESTS
 
 # Compile the tests to $(DIST)/bin.  Make lots of niceties available by default
 # through TestHarness.h, by modifying the list of includes and the libs against
 # which stuff links.
 CPPSRCS += $(CPP_UNIT_TESTS)