forked from AKSW/Erfurt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
149 lines (125 loc) · 5.36 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
ZENDVERSION=1.11.5
default:
@echo "please use:"
@echo ""
@echo " test ......................... Execute unit and integration tests"
@echo " test-unit .................... Run Erfurt unit tests"
@echo " test-unit-cc ................. Same as above plus code coverage report"
@echo " test-integration-virtuoso .... Run Erfurt integration tests with virtuoso"
@echo " test-integration-virtuoso-cc . Same as above plus code coverage report"
@echo " test-integration-mysql ....... Run Erfurt integration tests with mysql"
@echo " test-integration-mysql-cc .... Same as above plus code coverage report"
@echo " test-clean ................... Clean test cache files, etc."
@echo " ----------------------------------------------------------------------"
@echo " cs-install ................... install CodeSniffer"
@echo " cs-uninstall ................. uninstall CodeSniffer"
@echo " cs-enable .................... enable CodeSniffer to check code before"
@echo " every commit"
@echo " cs-disable ................... disable CodeSniffer code checking"
@echo " cs-check-commit .............. run pre-commit code checking manually)"
@echo " cs-check-commit-emacs' ....... same as above with emacs output)"
@echo " cs-check-commit-intensive .... run pre-commit code checking"
@echo " manually with stricter coding"
@echo " standard"
@echo " cs-check ..................... run complete code checking"
@echo " cs-check-full ................ run complete code checking with detailed"
@echo " output"
@echo " cs-check-emacs ............... run complete code checking with with"
@echo " emacs output"
@echo " cs-check-blame ............... run complete code checking with blame"
@echo " list output"
@echo " cs-check-intensive ........... run complete code checking with"
@echo " stricter coding standard"
@echo " cs-check-intensive-full ...... run complete code checking with"
@echo " stricter coding standard and detailed"
@echo " output"
@echo ""
@echo " Possible parameters:"
@echo " CHECKPATH=<path> (run code checking on specific relative path)"
@echo " SNIFFS=<sniff 1>,<sniff 2> (run code checking on specific sniffs)"
@echo " OPTIONS=<option> (run code checking with specific CodeSniffer options)"
clean:
rm -rf cache/* logs/*
directories: clean
mkdir -p logs cache
chmod 777 logs cache
zend:
rm -rf libraries/Zend
curl -L -# -O https://packages.zendframework.com/releases/ZendFramework-${ZENDVERSION}/ZendFramework-${ZENDVERSION}-minimal.tar.gz || wget https://packages.zendframework.com/releases/ZendFramework-${ZENDVERSION}/ZendFramework-${ZENDVERSION}-minimal.tar.gz
tar xzf ZendFramework-${ZENDVERSION}-minimal.tar.gz
mv ZendFramework-${ZENDVERSION}-minimal/library/Zend library
rm -rf ZendFramework-${ZENDVERSION}-minimal.tar.gz ZendFramework-${ZENDVERSION}-minimal
# coding standard
# #### config ####
# cs-script path
CSSPATH = tests/CodeSniffer/
# ignore pattern
IGNOREPATTERN = */libraries/*,*/Parser/Sparql10/*,*/Parser/Sparql11/*
# Parameter check
ifndef CHECKPATH
CHECKPATH = "./"
endif
ifdef SNIFFS
SNIFFSTR = "--sniffs="$(SNIFFS)
else
SNIFFSTR =
endif
REQUESTSTR = --ignore=$(IGNOREPATTERN) $(OPTIONS) $(SNIFFSTR) $(CHECKPATH)
cs-default:
chmod ugo+x "$(CSSPATH)cs-scripts.sh"
cs-install: cs-default
$(CSSPATH)cs-scripts.sh -i
cs-uninstall: cs-default
$(CSSPATH)cs-scripts.sh -u
cs-enable: cs-default
$(CSSPATH)cs-scripts.sh -f $(CSSPATH) -e
cs-disable: cs-default
$(CSSPATH)cs-scripts.sh -d
cs-check-commit:
$(CSSPATH)cs-scripts.sh -p ""
cs-check-commit-emacs:
$(CSSPATH)cs-scripts.sh -p "-remacs"
cs-check-commit-intensive:
$(CSSPATH)cs-scripts.sh -p "-s"
cs-check:
$(CSSPATH)cs-scripts.sh -c "-s --report=summary $(REQUESTSTR)"
cs-check-intensive:
$(CSSPATH)cs-scripts.sh -s -c "-s --report=summary $(REQUESTSTR)"
cs-check-intensive-full:
$(CSSPATH)cs-scripts.sh -s -c "-s --report=full $(REQUESTSTR)"
cs-check-full:
$(CSSPATH)cs-scripts.sh -c "-s --report=full $(REQUESTSTR)"
cs-check-emacs:
$(CSSPATH)cs-scripts.sh -c "--report=emacs $(REQUESTSTR)"
cs-check-blame:
$(CSSPATH)cs-scripts.sh -s -c "--report=gitblame $(REQUESTSTR)"
# test stuff
test-directories:
rm -rf tests/cache tests/unit/cache tests/integration/cache
mkdir tests/cache
mkdir tests/unit/cache
mkdir tests/integration/cache
test-unit: test-directories
@cd tests && phpunit --bootstrap Bootstrap.php unit/
test-unit-cc: test-directories
@cd tests/unit && phpunit
test-integration-virtuoso: test-directories
@cd tests && EF_STORE_ADAPTER=virtuoso phpunit --bootstrap Bootstrap.php integration/
test-integation-virtuoso-cc: test-directories
@cd tests/integration && EF_STORE_ADAPTER=virtuoso phpunit
test-integration-mysql: test-directories
@cd tests && EF_STORE_ADAPTER=zenddb phpunit --bootstrap Bootstrap.php integration/
test-integation-mysql-cc: test-directories
@cd tests/integration && EF_STORE_ADAPTER=zenddb phpunit
test:
make test-unit
@echo ""
@echo "-----------------------------------"
@echo ""
make test-integration-virtuoso
@echo ""
@echo "-----------------------------------"
@echo ""
make test-integration-mysql
test-clean:
rm -rf tests/unit/Erfurt/Sparql/_cache/*