From c880bc19f67baaa11313f49dfd971a65ba63b70f Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Thu, 28 Feb 2019 14:37:59 +0545 Subject: [PATCH] Move all make test targets into tests.mk --- Makefile | 49 ------------------------------------------------- rules/tests.mk | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/Makefile b/Makefile index 20cb60d5..9fe008ec 100644 --- a/Makefile +++ b/Makefile @@ -73,37 +73,6 @@ clean: clean-deps $(clean_rules) .PHONY: test test: $(test_rules) - -## -## Tests -##-------------------------------------- - -.PHONY: test-php-unit -test-php-unit: ## Run php unit tests -test-php-unit: - $(PHPUNIT) --configuration ./phpunit.xml --testsuite unit - -.PHONY: test-php-unit-dbg -test-php-unit-dbg: ## Run php unit tests using phpdbg -test-php-unit-dbg: - $(PHPUNITDBG) --configuration ./phpunit.xml --testsuite unit - -.PHONY: test-php-style -test-php-style: ## Run php-cs-fixer and check owncloud code-style -test-php-style: vendor-bin/owncloud-codestyle/vendor vendor-bin/php_codesniffer/vendor - $(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes --dry-run - $(PHP_CODESNIFFER) --runtime-set ignore_warnings_on_exit --standard=phpcs.xml tests/acceptance - -.PHONY: test-php-style-fix -test-php-style-fix: ## Run php-cs-fixer and fix code style issues -test-php-style-fix: vendor-bin/owncloud-codestyle/vendor - $(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes - -.PHONY: test-acceptance-api -test-acceptance-api: ## Run API acceptance tests -test-acceptance-api: $(acceptance_test_deps) - BEHAT_BIN=$(BEHAT_BIN) ../../tests/acceptance/run.sh --remote --type api - # # Dependency management #-------------------------------------- @@ -116,21 +85,3 @@ vendor: composer.lock vendor/bamarni/composer-bin-plugin: composer.lock composer install - -vendor-bin/owncloud-codestyle/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/owncloud-codestyle/composer.lock - composer bin owncloud-codestyle install --no-progress - -vendor-bin/owncloud-codestyle/composer.lock: vendor-bin/owncloud-codestyle/composer.json - @echo owncloud-codestyle composer.lock is not up to date. - -vendor-bin/php_codesniffer/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/php_codesniffer/composer.lock - composer bin php_codesniffer install --no-progress - -vendor-bin/php_codesniffer/composer.lock: vendor-bin/php_codesniffer/composer.json - @echo php_codesniffer composer.lock is not up to date. - -vendor-bin/behat/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/behat/composer.lock - composer bin behat install --no-progress - -vendor-bin/behat/composer.lock: vendor-bin/behat/composer.json - @echo behat composer.lock is not up to date. diff --git a/rules/tests.mk b/rules/tests.mk index 55fc3af6..a3ab8385 100644 --- a/rules/tests.mk +++ b/rules/tests.mk @@ -39,3 +39,50 @@ test-js-debug: $(js_deps) $(KARMA) js-templates test-syntax-js $(KARMA): $(nodejs_deps) $(JSHINT): $(nodejs_deps) +.PHONY: test-php-unit +test-php-unit: ## Run php unit tests +test-php-unit: vendor/bin/phpunit + $(PHPUNIT) --configuration ./phpunit.xml --testsuite unit + +.PHONY: test-php-unit-dbg +test-php-unit-dbg: ## Run php unit tests using phpdbg +test-php-unit-dbg: vendor/bin/phpunit + $(PHPUNITDBG) --configuration ./phpunit.xml --testsuite unit + +.PHONY: test-php-style +test-php-style: ## Run php-cs-fixer and check owncloud code-style +test-php-style: vendor-bin/owncloud-codestyle/vendor vendor-bin/php_codesniffer/vendor + $(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes --dry-run + $(PHP_CODESNIFFER) --runtime-set ignore_warnings_on_exit --standard=phpcs.xml tests/acceptance + +.PHONY: test-php-style-fix +test-php-style-fix: ## Run php-cs-fixer and fix code style issues +test-php-style-fix: vendor-bin/owncloud-codestyle/vendor + $(PHP_CS_FIXER) fix -v --diff --diff-format udiff --allow-risky yes + +.PHONY: test-acceptance-api +test-acceptance-api: ## Run API acceptance tests +test-acceptance-api: $(acceptance_test_deps) + BEHAT_BIN=$(BEHAT_BIN) ../../tests/acceptance/run.sh --remote --type api + +# +# Dependency management +#-------------------------------------- + +vendor-bin/owncloud-codestyle/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/owncloud-codestyle/composer.lock + composer bin owncloud-codestyle install --no-progress + +vendor-bin/owncloud-codestyle/composer.lock: vendor-bin/owncloud-codestyle/composer.json + @echo owncloud-codestyle composer.lock is not up to date. + +vendor-bin/php_codesniffer/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/php_codesniffer/composer.lock + composer bin php_codesniffer install --no-progress + +vendor-bin/php_codesniffer/composer.lock: vendor-bin/php_codesniffer/composer.json + @echo php_codesniffer composer.lock is not up to date. + +vendor-bin/behat/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/behat/composer.lock + composer bin behat install --no-progress + +vendor-bin/behat/composer.lock: vendor-bin/behat/composer.json + @echo behat composer.lock is not up to date.