From 6bc963569beb58d0799df4f747a2dcf1bcf8bf7b Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 29 Dec 2019 13:55:45 +0100 Subject: tec: Add a test target to Makefile (#2725) * tec: Add a test target to Makefile Minor edit put php7-phar on third line I try to keep on the third line the Alpine-specific PHP extensions (i.e. that are not by default in Ubuntu), and in alphabetic order Co-Authored-By: Alexandre Alapetite * Allow to run make test without Docker --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index dcb547c7d..87b8898e9 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,18 @@ endif PORT ?= 8080 PHP := $(shell sh -c 'which php') +ifdef NO_DOCKER + PHP = php +else + PHP = docker run \ + --rm \ + --volume $(shell pwd):/var/www/FreshRSS:z \ + --env FRESHRSS_ENV=development \ + --name freshrss-php-cli \ + freshrss/freshrss:$(TAG) \ + php +endif + ifeq ($(findstring alpine,$(TAG)),alpine) DOCKERFILE=Dockerfile-Alpine else ifeq ($(findstring arm,$(TAG)),arm) @@ -39,6 +51,18 @@ start: ## Start the development environment (use Docker) stop: ## Stop FreshRSS container if any docker stop freshrss-dev +########### +## Tests ## +########### +bin/phpunit: ## Install PHPUnit for test purposes + mkdir -p bin/ + wget -O bin/phpunit https://phar.phpunit.de/phpunit-7.5.9.phar + echo '5404288061420c3921e53dd3a756bf044be546c825c5e3556dea4c51aa330f69 bin/phpunit' | sha256sum -c - || rm bin/phpunit + +.PHONY: test +test: bin/phpunit ## Run the test suite + $(PHP) ./bin/phpunit --bootstrap ./tests/bootstrap.php ./tests + ########## ## I18N ## ########## -- cgit v1.2.3