Bug 1304593 - Use |mach python-test| to run python unittests from make check. r=ted, a=NPOTB
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Mon, 26 Sep 2016 15:29:02 -0400
changeset 358152 a55eeb63cbcc35a439e89338ceeabeda19dfc642
parent 358151 70218f843e80d3d278334fb0f518295c40e03ed5
child 358153 71786422299e933ddf613a5da2ab1ac007ecbcd5
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, NPOTB
bugs1304593
milestone51.0a2
Bug 1304593 - Use |mach python-test| to run python unittests from make check. r=ted, a=NPOTB Currently make check loops over all directories and runs each test file in PYTHON_UNIT_TESTS individually. This patch instead creates a single top-level check target that runs |mach python-tests|. This should make automation more similar to running locally, be a bit quicker and make it easier to pull python tests out of make check completely at a future date. MozReview-Commit-ID: 4Hg4zdFyc61
config/rules.mk
testing/testsuite-targets.mk
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -90,32 +90,16 @@ cppunittests-remote:
 			--deviceIP=${TEST_DEVICE} \
 			$(CPP_UNIT_TESTS) $(EXTRA_TEST_ARGS); \
 	else \
 		echo 'please prepare your host with environment variables for TEST_DEVICE'; \
 	fi
 
 endif # COMPILE_ENVIRONMENT
 endif # CPP_UNIT_TESTS
-
-.PHONY: check
-
-ifdef PYTHON_UNIT_TESTS
-
-RUN_PYTHON_UNIT_TESTS := $(addsuffix -run,$(PYTHON_UNIT_TESTS))
-
-.PHONY: $(RUN_PYTHON_UNIT_TESTS)
-
-check:: $(RUN_PYTHON_UNIT_TESTS)
-
-$(RUN_PYTHON_UNIT_TESTS): %-run: %
-	@PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $<
-
-endif # PYTHON_UNIT_TESTS
-
 endif # ENABLE_TESTS
 
 
 #
 # Library rules
 #
 # If FORCE_STATIC_LIB is set, build a static library.
 # Otherwise, build a shared library.
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -355,16 +355,21 @@ stage-instrumentation-tests: make-stage-
 TEST_EXTENSIONS := \
     specialpowers@mozilla.org.xpi \
 	$(NULL)
 
 stage-extensions: make-stage-dir
 	$(NSINSTALL) -D $(PKG_STAGE)/extensions/
 	@$(foreach ext,$(TEST_EXTENSIONS), cp -RL $(DIST)/xpi-stage/$(ext) $(PKG_STAGE)/extensions;)
 
+
+check::
+	@$(topsrcdir)/mach --log-no-times python-test
+
+
 .PHONY: \
   reftest \
   crashtest \
   xpcshell-tests \
   jstestbrowser \
   package-tests \
   package-tests-prepare-dest \
   package-tests-common \
@@ -376,9 +381,10 @@ stage-extensions: make-stage-dir
   stage-jstests \
   stage-android \
   stage-jetpack \
   stage-marionette \
   stage-steeplechase \
   stage-instrumentation-tests \
   stage-luciddream \
   test-packages-manifest \
+  check \
   $(NULL)