diff --git a/config/rules.mk b/config/rules.mk index e98c147c9e4a..98c20795633f 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -162,10 +162,16 @@ ifdef CPP_UNIT_TESTS # through TestHarness.h, by modifying the list of includes and the libs against # which stuff links. CPPSRCS += $(CPP_UNIT_TESTS) -SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX)) +CPP_UNIT_TEST_BINS := $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX)) +SIMPLE_PROGRAMS += $(CPP_UNIT_TEST_BINS) INCLUDES += -I$(DIST)/include/testing LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS) $(MOZ_JS_LIBS) $(if $(JS_SHARED_LIBRARY),,$(MOZ_ZLIB_LIBS)) +ifndef MOZ_PROFILE_GENERATE +libs:: $(CPP_UNIT_TEST_BINS) $(call mkdir_deps,$(DIST)/cppunittests) + $(NSINSTALL) $(CPP_UNIT_TEST_BINS) $(DIST)/cppunittests +endif + check:: @$(PYTHON) $(topsrcdir)/testing/runcppunittests.py --xre-path=$(DIST)/bin --symbols-path=$(DIST)/crashreporter-symbols $(subst .cpp,$(BIN_SUFFIX),$(CPP_UNIT_TESTS)) diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index e98c147c9e4a..98c20795633f 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -162,10 +162,16 @@ ifdef CPP_UNIT_TESTS # through TestHarness.h, by modifying the list of includes and the libs against # which stuff links. CPPSRCS += $(CPP_UNIT_TESTS) -SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX)) +CPP_UNIT_TEST_BINS := $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX)) +SIMPLE_PROGRAMS += $(CPP_UNIT_TEST_BINS) INCLUDES += -I$(DIST)/include/testing LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS) $(MOZ_JS_LIBS) $(if $(JS_SHARED_LIBRARY),,$(MOZ_ZLIB_LIBS)) +ifndef MOZ_PROFILE_GENERATE +libs:: $(CPP_UNIT_TEST_BINS) $(call mkdir_deps,$(DIST)/cppunittests) + $(NSINSTALL) $(CPP_UNIT_TEST_BINS) $(DIST)/cppunittests +endif + check:: @$(PYTHON) $(topsrcdir)/testing/runcppunittests.py --xre-path=$(DIST)/bin --symbols-path=$(DIST)/crashreporter-symbols $(subst .cpp,$(BIN_SUFFIX),$(CPP_UNIT_TESTS)) diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk index d001846c2868..29cb7b3edc84 100644 --- a/testing/testsuite-targets.mk +++ b/testing/testsuite-targets.mk @@ -399,6 +399,7 @@ package-tests: \ stage-tps \ stage-modules \ stage-marionette \ + stage-cppunittests \ $(NULL) else # This staging area has been built for us by universal/flight.mk @@ -485,6 +486,12 @@ stage-modules: make-stage-dir $(NSINSTALL) -D $(PKG_STAGE)/modules cp -RL $(DEPTH)/_tests/modules $(PKG_STAGE) +stage-cppunittests: + $(NSINSTALL) -D $(PKG_STAGE)/cppunittests + $(NSINSTALL) $(topsrcdir)/testing/runcppunittests.py $(PKG_STAGE)/cppunittests + $(NSINSTALL) $(topsrcdir)/testing/remotecppunittests.py $(PKG_STAGE)/cppunittests + cp -RL $(DIST)/cppunittests $(PKG_STAGE) + MARIONETTE_DIR=$(PKG_STAGE)/marionette stage-marionette: make-stage-dir $(NSINSTALL) -D $(MARIONETTE_DIR)/tests