-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
186 lines (160 loc) · 6.35 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: Apache License 2.0
#
# Copyright (c) 2011-2015 MathJax Consortium, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Contributor(s):
# Frederic Wang <fred.wang@ free.fr> (original author)
#
# ***** END LICENSE BLOCK *****
include custom.cfg
VERSION=$(SELENIUM_SERVER_VERSION)
help:
@echo ''
@echo 'The following commands are available:'
@echo ' make help'
@echo ' make config'
@echo ' make reftests'
@echo ' make doc'
@echo ' make updateSeleniumDriver'
@echo ' make downloadSeleniumServer VERSION=$(SELENIUM_SERVER_VERSION)'
@echo ' make updateMathJaxBranches'
@echo ' make clearMathJaxBranches'
@echo ' make clearTaskList'
@echo ' make runTaskHandler'
@echo ' make runSeleniumServer'
@echo ' make runSeleniumHub'
@echo ' make runSeleniumNode'
generateBranchList:
@ echo 'Generate $(WEB_BRANCH_LIST)...'
@ echo '<?php' > $(WEB_BRANCH_LIST)
@ echo '/* $(WARNING_GENERATED_FILE) */' >> $(WEB_BRANCH_LIST)
@ echo '$$BRANCH_LIST = array(' >> $(WEB_BRANCH_LIST)
@ for USER in $(MATHJAX_GIT_USERS); \
do \
for BRANCH in `ls mathjax/$$USER/`; \
do \
echo \'$$USER/$$BRANCH/\', >> $(WEB_BRANCH_LIST); \
done; \
done
@ $(SED) -i '$$s/,//' $(WEB_BRANCH_LIST)
@ echo ');' >> $(WEB_BRANCH_LIST)
@ echo '?>' >> $(WEB_BRANCH_LIST)
config:
@ echo 'Generate $(CONDITION_PARSER), $(CONFIG_PY), $(CONFIG_PHP) and $(CONFIG_JS)...'
@ $(SED) 's|###||' <custom.cfg >custom.cfg.tmp
@ $(PYTHON) generateConfigFiles.py
@ rm custom.cfg.tmp
@ echo 'Generate $(WEB_HTACCESS)...'
@ cp $(WEB_HTACCESS)-tpl $(WEB_HTACCESS)
@ $(SED) -i '1i\
# $(WARNING_GENERATED_FILE)' $(WEB_HTACCESS)
@ if [ -n "$(QA_USER_NAME)" -a -n "$(QA_PASSWORD_FILE)" ] ;\
then\
$(SED) -i 's|QA_USER_NAME|$(QA_USER_NAME)|' $(WEB_HTACCESS);\
$(SED) -i 's|QA_PASSWORD_FILE|$(QA_PASSWORD_FILE)|' $(WEB_HTACCESS);\
else \
$(SED) -i '/Secure Access Begin/,/Secure Access End/d' $(WEB_HTACCESS);\
fi
@ echo 'Generate $(TESTSUITE_HEADER)'
@ cp $(TESTSUITE_HEADER)-tpl $(TESTSUITE_HEADER)
@ $(SED) -i '1i\
/* $(WARNING_GENERATED_FILE) */' $(TESTSUITE_HEADER)
@ $(SED) -i 's|DEFAULT_MATHJAX_PATH|$(MATHJAX_TEST_PUBLIC_URI)$(DEFAULT_MATHJAX_BRANCH)|' $(TESTSUITE_HEADER)
@ echo 'Generate $(WEB_REFTEST_LIST)...'
@ cd testRunner/; $(PYTHON) runTestsuite.py -p > /dev/null
@ echo 'Generate $(WEB_TESTSUITE_NOTES)...'
@ cd testRunner/; $(PYTHON) runTestsuite.py -n > /dev/null
@ echo 'Generate $(DOXYGEN_CONFIG)...'
@ $(DOXYGEN) -s -g $(DOXYGEN_CONFIG) > /dev/null
@ $(SED) -i '1i\
# $(WARNING_GENERATED_FILE)' $(DOXYGEN_CONFIG)
@ $(SED) -i '/PROJECT_NAME / c\
PROJECT_NAME = MathJax-test/' $(DOXYGEN_CONFIG)
@ $(SED) -i '/INLINE_INHERITED_MEMB / c\
INLINE_INHERITED_MEMB = YES' $(DOXYGEN_CONFIG)
@ $(SED) -i '/EXTENSION_MAPPING / c\
EXTENSION_MAPPING = py=Python js=Javascript' $(DOXYGEN_CONFIG)
@ $(SED) -i '/HIDE_UNDOC_MEMBERS / c\
HIDE_UNDOC_MEMBERS = YES' $(DOXYGEN_CONFIG)
@ $(SED) -i '/SHOW_DIRECTORIES / c\
SHOW_DIRECTORIES = YES' $(DOXYGEN_CONFIG)
@ $(SED) -i '/INPUT / c\
INPUT = ../../web/ ../../testsuite/ ../../testRunner/ ./doxygenMain.txt' $(DOXYGEN_CONFIG)
@ $(SED) -i '/FILE_PATTERNS / c\
FILE_PATTERNS = *.py *.pl *.php *.js' $(DOXYGEN_CONFIG)
@ $(SED) -i '/EXCLUDE / c\
EXCLUDE = ../testRunner/parsetab.py ../testRunner/config.py ../web/config.php' $(DOXYGEN_CONFIG)
@ $(SED) -i '/FILTER_PATTERNS / c\
FILTER_PATTERNS = *.py=$(DOXYGEN_PYTHON_FILTER) *.pl=$(DOXYGEN_PERL_FILER) *.js=$(DOXYGEN_JAVASCRIPT_FILTER)' $(DOXYGEN_CONFIG)
@ $(SED) -i '/FILTER_SOURCE_FILES / c\
FILTER_SOURCE_FILES = YES' $(DOXYGEN_CONFIG)
@ $(SED) -i '/HTML_OUTPUT / c\
HTML_OUTPUT = doxygen/' $(DOXYGEN_CONFIG)
@ $(SED) -i '/GENERATE_LATEX / c\
GENERATE_LATEX = NO' $(DOXYGEN_CONFIG)
@ make generateBranchList
reftests:
@ echo 'Generate $(WEB_REFTEST_LIST)...'
@ cd testRunner/; $(PYTHON) runTestsuite.py -p > /dev/null
@ echo 'Generate $(WEB_TESTSUITE_NOTES)...'
@ cd testRunner/; $(PYTHON) runTestsuite.py -n > /dev/null
doc:
@ echo 'Build doxygen documentation...'
@ cd web/docs ; make doxygen > /dev/null
@ echo 'Build html documentation...'
@ cd web/docs ; make html > /dev/null
updateSeleniumDriver:
@ echo 'Updating Selenium python driver...'
@ $(PIP) install --upgrade selenium
downloadSeleniumServer:
@ echo 'Downloading the selenium server...'
@ $(WGET) http://selenium.googlecode.com/files/selenium-server-standalone-$(VERSION).jar
@ mv -f selenium-server-standalone-$(VERSION).jar testRunner/seleniumServer.jar
updateMathJaxBranches:
@ for USER in $(MATHJAX_GIT_USERS); \
do \
echo "Updating `echo $$USER` branches..."; \
cd mathjax; ./getMathJaxBranches.sh $$USER; cd ..; \
done
@ make generateBranchList
clearMathJaxBranches:
@ echo 'Clearing MathJax branches...'
@ for USER in $(MATHJAX_GIT_USERS); \
do \
echo "Clearing `echo $$USER` branches..."; \
rm -rf mathjax/$$USER; \
done
clearTaskList:
@ echo 'Clearing task list...'
rm -f testRunner/taskList.txt
rm -f testRunner/config/taskList/*.cfg
runTaskHandler:
@ echo 'Running the task handler...'
@ cd testRunner/ ; $(PYTHON) taskHandler.py
runSeleniumServer:
@ echo 'Running selenium server (default mode)...'
@ cd testRunner/; $(JAVA) -jar seleniumServer.jar -port $(SELENIUM_SERVER_PORT)
runSeleniumHub:
@ echo 'Running selenium server (Hub mode)...'
@ cd testRunner/; $(JAVA) -jar seleniumServer.jar -role hub -port $(SELENIUM_SERVER_HUB_PORT)
runSeleniumNode:
@ echo 'Running selenium server (Node mode)...'
cd testRunner/; $(JAVA) -jar seleniumServer.jar -role node -port $(SELENIUM_SERVER_NODE_PORT) -hubHost $(SELENIUM_SERVER_HUB_HOST) -hubPort $(SELENIUM_SERVER_HUB_PORT) `for opt in $(SELENIUM_SERVER_NODE_OPTIONS); do echo "-browser $$opt"; done;` -nodeTimeout $(SELENIUM_SERVER_NODE_TIMEOUT)
generateReadyForRelease:
@ echo 'Generating githubParser/IssueList.txt...'
@ cd githubParser; $(PYTHON) githubParser.py