Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

Merge PR #1900 of https://github.com/asciimoo/searx into filtron

Markus Heiser65b22be1f4e6
diff --cc Makefile
index 84f0ac24b,d09e92828..acff120f3
--- a/Makefile
+++ b/Makefile
@@@ -28,19 -28,13 +28,22 @@@ help-min
@echo ' gh-pages - build docs & deploy on gh-pages branch'
@echo ' clean - drop builds and environments'
@echo ' project - re-build generic files of the searx project'
+ @echo ' themes - re-build build the source of the themes'
+ @echo ' docker - build Docker image'
+ @echo ' node.env - download & install npm dependencies locally'
@echo ''
- @$(MAKE) -s -f utils/makefile.include make-help
+ @echo 'environment'
+ @echo ' SEARX_URL = $(SEARX_URL)'
+ @echo ' GIT_URL = $(GIT_URL)'
+ @echo ' DOCS_URL = $(DOCS_URL)'
+ @echo ''
+ @$(MAKE) -e -s make-help
+
+help-all: help-min
+ @echo ''
+ @$(MAKE) -e -s python-help
@echo ''
- @$(MAKE) -s -f utils/makefile.python python-help
+ @$(MAKE) -e -s docs-help
PHONY += install
install: pyenvinstall
@@@ -49,7 -43,7 +52,7 @@@ PHONY += uninstal
uninstall: pyenvuninstall
PHONY += clean
- clean: pyclean docs-clean
-clean: pyclean node.clean test.clean
++clean: pyclean docs-clean node.clean test.clean
$(call cmd,common_clean)
PHONY += run
@@@ -100,34 -178,42 +195,52 @@@ gecko.driver
# test
# ----
- PHONY += test test.sh test.pylint test.pep8 test.unit test.robot
-PHONY += test test.pylint test.pep8 test.unit test.coverage test.robot
--
- test: test.pylint test.pep8 test.unit test.robot
++PHONY += test test.sh test.pylint test.pep8 test.unit test.coverage test.robot
+ test: test.pylint test.pep8 test.unit gecko.driver test.robot
# TODO: balance linting with pylint
+
test.pylint: pyenvinstall
- $(call cmd,pylint,searx/preferences.py)
- $(call cmd,pylint,searx/testing.py)
+ $(call cmd,pylint,\
+ searx/preferences.py \
+ searx/testing.py \
+ )
+
+ # ignored rules:
+ # E402 module level import not at top of file
+ # W503 line break before binary operator
+# ubu1604: uses shellcheck v0.3.7 (from 04/2015), no longer supported!
+test.sh:
+ shellcheck -x utils/lib.sh
+ shellcheck -x utils/filtron.sh
+ shellcheck -x utils/searx.sh
+ shellcheck -x utils/morty.sh
+ shellcheck -x utils/lxc.sh
+ shellcheck -x utils/lxc-searx.env
+ shellcheck -x .config.sh
+
test.pep8: pyenvinstall
- $(PY_ENV_ACT); ./manage.sh pep8_check
+ @echo "TEST pep8"
+ $(Q)$(PY_ENV_ACT); pep8 --exclude=searx/static --max-line-length=120 --ignore "E402,W503" searx tests
test.unit: pyenvinstall
- $(PY_ENV_ACT); ./manage.sh unit_tests
-
- test.robot: pyenvinstall
- $(PY_ENV_ACT); ./manage.sh install_geckodriver
- $(PY_ENV_ACT); ./manage.sh robot_tests
+ @echo "TEST tests/unit"
+ $(Q)$(PY_ENV_ACT); python -m nose2 -s tests/unit
+
+ test.coverage: pyenvinstall
+ @echo "TEST unit test coverage"
+ $(Q)$(PY_ENV_ACT); \
+ python -m nose2 -C --log-capture --with-coverage --coverage searx -s tests/unit \
+ && coverage report \
+ && coverage html \
+
+ test.robot: pyenvinstall gecko.driver
+ @echo "TEST robot"
+ $(Q)$(PY_ENV_ACT); PYTHONPATH=. python searx/testing.py robot
+
+ test.clean:
+ @echo "CLEAN intermediate test stuff"
+ $(Q)rm -rf geckodriver.log .coverage coverage/
.PHONY: $(PHONY)