From 55d2d10b619275f83c915390583d00ebfc6d1254 Mon Sep 17 00:00:00 2001 From: Evan Xd Date: Fri, 6 Dec 2013 11:21:17 +0800 Subject: [PATCH] Bug 945611 - Run marionette tests for a specific app. --- Makefile | 18 ++++++++++++------ README.md | 8 ++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f380c53e92cb..09c60f968ca6 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ NOFTU?=0 # Automatically enable remote debugger REMOTE_DEBUGGER?=0 -ifeq ($(DEVICE_DEBUG), 1) +ifeq ($(DEVICE_DEBUG),1) REMOTE_DEBUGGER=1 endif @@ -101,6 +101,8 @@ PROFILE_FOLDER?=profile-debug else ifeq ($(DESKTOP),1) NOFTU=1 PROFILE_FOLDER?=profile-debug +else ifeq ($(MAKECMDGOALS),test-integration) +PROFILE_FOLDER?=profile-test endif PROFILE_FOLDER?=profile @@ -121,8 +123,13 @@ endif HOMESCREEN?=$(SCHEME)system.$(GAIA_DOMAIN) BUILD_APP_NAME?=* +TEST_INTEGRATION_APP_NAME?=* ifneq ($(APP),) -BUILD_APP_NAME=$(APP) + ifeq ($(MAKECMDGOALS), test-integration) + TEST_INTEGRATION_APP_NAME=$(APP) + else + BUILD_APP_NAME=$(APP) + endif endif REPORTER?=Spec @@ -716,10 +723,9 @@ b2g: node_modules/.bin/mozilla-download --branch mozilla-central $@ .PHONY: test-integration -test-integration: - # override existing profile-test folder. - PROFILE_FOLDER=profile-test make - NPM_REGISTRY=$(NPM_REGISTRY) ./bin/gaia-marionette $(shell find . -path "*test/marionette/*_test.js") \ +# $(PROFILE_FOLDER) should be `profile-test` when we do `make test-integration`. +test-integration: b2g $(PROFILE_FOLDER) + NPM_REGISTRY=$(NPM_REGISTRY) ./bin/gaia-marionette $(shell find . -path "*$(TEST_INTEGRATION_APP_NAME)/test/marionette/*_test.js") \ --host $(MARIONETTE_RUNNER_HOST) \ --reporter $(REPORTER) diff --git a/README.md b/README.md index aded64c0ff91..76c41e996f02 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,14 @@ All options are passed to `./node_modules/.bin/marionette-mocha` so you can also use mocha commands like `--grep`, `--timeout` see `--help` for more options. +#### Invoking tests for a specific app + +```sh +make test-integration APP= +``` + +For example, we could run all tests for the calendar app with `make test-integration APP=calendar`. + #### Invoking all the tests NOTE: unless you tests end in _test.js they will not be