Bug 454320 - top level test targets should support specifying a test path
authorShawn Wilsher <sdwilsh@shawnwilsher.com>
Sun, 14 Sep 2008 12:11:00 -0400
changeset 19241 07cb359d26bca3599eb31da36cf52085c23edf4f
parent 19240 bceda53ebeb741ab91db54ffd457257f66e3c8b2
child 19242 19030b97ca13c342e5116c128cbe604d2905c0ab
push id2051
push usersdwilsh@shawnwilsher.com
push dateSun, 14 Sep 2008 16:13:54 +0000
treeherdermozilla-central@07cb359d26bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs454320
milestone1.9.1b1pre
Bug 454320 - top level test targets should support specifying a test path This changeset allows the specifying of the --test-path parameter when using the top-level targets to run mochi-type tests. r=ted
browser/build.mk
testing/testsuite-targets.mk
--- a/browser/build.mk
+++ b/browser/build.mk
@@ -57,16 +57,24 @@ installer:
 package:
 	@$(MAKE) -C browser/installer
 
 install::
 	@$(MAKE) -C browser/installer install
 
 ifdef ENABLE_TESTS
 # Implemented in testing/testsuite-targets.mk
+
+# Browser tests live in a slightly different location, so we correct the path
+ifdef TEST_PATH
+BROWSER_TEST_PATH = --test-path=../browser/$(TEST_PATH)
+else
+BROWSER_TEST_PATH =
+endif
+
 mochitest-browser-chrome:
-	$(RUN_MOCHITEST) --browser-chrome
+	$(RUN_MOCHITEST) --browser-chrome $(BROWSER_TEST_PATH)
 	$(CHECK_TEST_ERROR)
 
 mochitest:: mochitest-browser-chrome
 
 .PHONY: mochitest-browser-chrome
 endif
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -47,21 +47,27 @@ define CHECK_TEST_ERROR
 	  echo "$$errors"; \
 	  exit 1; \
   else \
 	  echo "$@ passed"; \
   fi
 endef
 endif
 
+ifdef TEST_PATH
+MOCHITEST_PATH = --test-path=$(TEST_PATH)
+else
+MOCHITEST_PATH =
+endif
+
 mochitest-plain:
-	$(RUN_MOCHITEST)
+	$(RUN_MOCHITEST) $(MOCHITEST_PATH)
 	$(CHECK_TEST_ERROR)
 
 mochitest-chrome:
-	$(RUN_MOCHITEST) --chrome
+	$(RUN_MOCHITEST) --chrome $(MOCHITEST_PATH)
 	$(CHECK_TEST_ERROR)
 
 mochitest-a11y:
-	$(RUN_MOCHITEST) --a11y
+	$(RUN_MOCHITEST) --a11y $(MOCHITEST_PATH)
 	$(CHECK_TEST_ERROR)
 
 .PHONY: mochitest mochitest-plain mochitest-chrome mochitest-a11y