-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathMakefile
54 lines (43 loc) · 1.33 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
NO_COLOR=\x1b[0m
OK_COLOR=\x1b[32;01m
ERROR_COLOR=\x1b[31;01m
WARN_COLOR=\x1b[33;01m
PHP=php
PHP_NO_INI=php -n
PHPUNIT=vendor/bin/phpunit
all: autoload tests testdox cov
autoload:
php composer.phar dumpautoload
t: test
test: unit feature
unit:
$(PHP) $(PHPUNIT) -c phpunit.xml.dist
f: feature
feature:
@$(PHP) $(PHPUNIT) tests/feature --testdox\
| sed 's/\[x\]/$(OK_COLOR)$\[x]$(NO_COLOR)/' \
| sed -r 's/(\[ \].+)/$(ERROR_COLOR)\1$(NO_COLOR)/' \
| sed -r 's/(^[^ ].+)/$(WARN_COLOR)\1$(NO_COLOR)/'
d: testdox
testdox:
@$(PHP_NO_INI) $(PHPUNIT) -c phpunit.xml.dist --testdox tests \
| sed 's/\[x\]/$(OK_COLOR)$\[x]$(NO_COLOR)/' \
| sed -r 's/(\[ \].+)/$(ERROR_COLOR)\1$(NO_COLOR)/' \
| sed -r 's/(^[^ ].+)/$(WARN_COLOR)\1$(NO_COLOR)/'
testdox-osx:
@$(PHP_NO_INI) $(PHPUNIT) -c phpunit.xml.dist --testdox tests \
| sed 's/\[x\]/$(OK_COLOR)$\[x]$(NO_COLOR)/' \
| sed -E 's/(\[ \].+)/$(ERROR_COLOR)\1$(NO_COLOR)/' \
| sed -E 's/(^[^ ].+)/$(WARN_COLOR)\1$(NO_COLOR)/'
c: cov
cov:
@$(PHP) $(PHPUNIT) -c phpunit.xml.dist --coverage-text
s: style
style:
@$(PHP_NO_INI) vendor/bin/php-cs-fixer fix --level=psr2 --verbose src
@$(PHP_NO_INI) vendor/bin/php-cs-fixer fix --level=psr2 --verbose tests
phar:
@php composer.phar update --no-dev
@$(PHP) box.phar build
@chmod +x build/dephpend.phar
@php composer.phar update