@@ -43,7 +43,7 @@ PHONY += uninstall
43uninstall: pyenvuninstall
43uninstall: pyenvuninstall
45PHONY += clean
45PHONY += clean
46−clean: pyclean node.clean
46+clean: pyclean node.clean test.clean
47 $(call cmd,common_clean)
47 $(call cmd,common_clean)
49PHONY += run
49PHONY += run
@@ -160,27 +160,52 @@ PHONY += docker
161 $(Q)./manage.sh docker_build
161 $(Q)./manage.sh docker_build
166+PHONY += gecko.driver
168+ $(PY_ENV_ACT); ./manage.sh install_geckodriver
167−PHONY += test test.pylint test.pep8 test.unit test.robot
173+PHONY += test test.pylint test.pep8 test.unit test.coverage test.robot
169−test: test.pylint test.pep8 test.unit test.robot
175+test: test.pylint test.pep8 test.unit gecko.driver test.robot
171# TODO: balance linting with pylint
177# TODO: balance linting with pylint
172test.pylint: pyenvinstall
178test.pylint: pyenvinstall
173− $(call cmd,pylint,searx/preferences.py)
180+ searx/preferences.py \
174− $(call cmd,pylint,searx/testing.py)
181+ searx/testing.py \
185+# E402 module level import not at top of file
186+# W503 line break before binary operator
176test.pep8: pyenvinstall
188test.pep8: pyenvinstall
177− $(PY_ENV_ACT); ./manage.sh pep8_check
189+ @echo "TEST pep8"
190+ $(Q)$(PY_ENV_ACT); pep8 --exclude=searx/static --max-line-length=120 --ignore "E402,W503" searx tests
179test.unit: pyenvinstall
192test.unit: pyenvinstall
180− $(PY_ENV_ACT); ./manage.sh unit_tests
193+ @echo "TEST tests/unit"
181−
194+ $(Q)$(PY_ENV_ACT); python -m nose2 -s tests/unit
196+test.coverage: pyenvinstall
197+ @echo "TEST unit test coverage"
198+ $(Q)$(PY_ENV_ACT); \
199+ python -m nose2 -C --log-capture --with-coverage --coverage searx -s tests/unit \
200+ && coverage report \
182−test.robot: pyenvinstall
203+test.robot: pyenvinstall gecko.driver
183− $(PY_ENV_ACT); ./manage.sh install_geckodriver
204+ @echo "TEST robot"
184− $(PY_ENV_ACT); ./manage.sh robot_tests
205+ $(Q)$(PY_ENV_ACT); PYTHONPATH=. python searx/testing.py robot
208+ @echo "CLEAN intermediate test stuff"
209+ $(Q)rm -rf geckodriver.log .coverage coverage/
186.PHONY: $(PHONY)
211.PHONY: $(PHONY)