-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
34 lines (25 loc) · 889 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
BASEDIR=$(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
PHPCS=$(BASEDIR)/vendor/bin/phpcs
PHPUNIT=$(BASEDIR)/vendor/bin/phpunit
PHPUNIT_CONFIG=$(BASEDIR)/tests/phpunit.xml
PHPUNIT_REPORT=$(BASEDIR)/tests/report/
PHPCS_CONFIG=$(BASEDIR)/tests/phpcs.xml
ifeq ($(origin TARGET), undefined)
UNIT_TARGET=$(BASEDIR)/tests
LINT_TARGET=$(BASEDIR)
else
UNIT_TARGET=$(TARGET)
LINT_TARGET=$(TARGET)
endif
check: lint test-report
$(PHPCS) $(PHPUNIT):
composer install --working-dir $(BASEDIR)
test: $(PHPUNIT)
$(PHPUNIT) -c $(PHPUNIT_CONFIG) $(UNIT_TARGET)
test-report: $(PHPUNIT)
$(PHPUNIT) -c $(PHPUNIT_CONFIG) --coverage-html $(PHPUNIT_REPORT) $(UNIT_TARGET)
@echo Check out file://$(abspath $(BASEDIR)/tests/report/index.html)
lint: $(PHPCS)
$(PHPCS) -p --standard=$(PHPCS_CONFIG) $(LINT_TARGET)
update: $(PHPCS) $(PHPUNIT)
.PHONY: update test test-report lint check