Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
make test: improve documentation and PEP8 compliance
[vpp.git]
/
test
/
Makefile
diff --git
a/test/Makefile
b/test/Makefile
index
7561a00
..
543fe91
100644
(file)
--- a/
test/Makefile
+++ b/
test/Makefile
@@
-7,16
+7,21
@@
endif
PYTHON_VENV_PATH=$(VPP_PYTHON_PREFIX)/virtualenv
PYTHON_DEPENDS=scapy==2.3.3 pexpect
PYTHON_VENV_PATH=$(VPP_PYTHON_PREFIX)/virtualenv
PYTHON_DEPENDS=scapy==2.3.3 pexpect
-SCAPY_SOURCE=$(
WS_ROOT)/build-root/python/virtualenv
/lib/python2.7/site-packages/
+SCAPY_SOURCE=$(
PYTHON_VENV_PATH)
/lib/python2.7/site-packages/
BUILD_COV_DIR = $(BR)/test-cov
BUILD_COV_DIR = $(BR)/test-cov
+PIP_INSTALL_DONE=$(VPP_PYTHON_PREFIX)/pip-install.done
+PIP_PATCH_DONE=$(VPP_PYTHON_PREFIX)/pip-patch.done
+PAPI_INSTALL_DONE=$(VPP_PYTHON_PREFIX)/papi-install.done
-.pip-install.ok:
- @virtualenv $(PYTHON_VENV_PATH)
+PAPI_INSTALL_FLAGS=$(PIP_INSTALL_DONE) $(PIP_PATCH_DONE) $(PAPI_INSTALL_DONE)
+
+$(PIP_INSTALL_DONE):
+ @virtualenv $(PYTHON_VENV_PATH) -p python2.7
@bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS)"
@touch $@
@bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS)"
@touch $@
-.pip-patch.ok: .pip-install.ok
+$(PIP_PATCH_DONE): $(PIP_INSTALL_DONE)
@echo --- patching ---
for f in $(CURDIR)/patches/scapy-2.3.3/*.patch ; do \
echo Applying patch: $$(basename $$f) ; \
@echo --- patching ---
for f in $(CURDIR)/patches/scapy-2.3.3/*.patch ; do \
echo Applying patch: $$(basename $$f) ; \
@@
-24,18
+29,15
@@
BUILD_COV_DIR = $(BR)/test-cov
done
@touch $@
done
@touch $@
-.install.ok: .pip-patch.ok
- @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && cd $(WS_ROOT)/vpp-api/python && python setup.py install"
+$(PAPI_INSTALL_DONE): $(PIP_PATCH_DONE)
+ @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && cd $(WS_ROOT)/
src/
vpp-api/python && python setup.py install"
@touch $@
@touch $@
-PHONIES=.install.ok .pip-patch.ok .pip-install.ok
-.PHONY: $(PHONIES)
-
define retest-func
@bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\""
endef
define retest-func
@bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\""
endef
-test: reset verify-python-path
.install.ok
+test: reset verify-python-path
$(PAPI_INSTALL_DONE)
$(call retest-func)
retest: reset verify-python-path
$(call retest-func)
retest: reset verify-python-path
@@
-48,17
+50,20
@@
reset:
@rm -rf /tmp/vpp-unittest-*
wipe: reset
@rm -rf /tmp/vpp-unittest-*
wipe: reset
- @rm -f $(PHONIES)
+ @rm -rf $(PYTHON_VENV_PATH)
+ @rm -f $(PAPI_INSTALL_FLAGS)
doc: verify-python-path
doc: verify-python-path
- @virtualenv $(PYTHON_VENV_PATH)
+ @virtualenv $(PYTHON_VENV_PATH)
-p python2.7
@bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS) sphinx"
@bash -c "source $(PYTHON_VENV_PATH)/bin/activate && make -C doc WS_ROOT=$(WS_ROOT) BR=$(BR) NO_VPP_PAPI=1 html"
@bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS) sphinx"
@bash -c "source $(PYTHON_VENV_PATH)/bin/activate && make -C doc WS_ROOT=$(WS_ROOT) BR=$(BR) NO_VPP_PAPI=1 html"
+.PHONY: wipe-doc
+
wipe-doc:
@make -C doc wipe BR=$(BR)
wipe-doc:
@make -C doc wipe BR=$(BR)
-cov: wipe-cov reset verify-python-path
.install.ok
+cov: wipe-cov reset verify-python-path
$(PAPI_INSTALL_DONE)
@lcov --zerocounters --directory $(VPP_TEST_BUILD_DIR)
$(call retest-func)
@mkdir $(BUILD_COV_DIR)
@lcov --zerocounters --directory $(VPP_TEST_BUILD_DIR)
$(call retest-func)
@mkdir $(BUILD_COV_DIR)
@@
-67,6
+72,8
@@
cov: wipe-cov reset verify-python-path .install.ok
@echo
@echo "Build finished. Code coverage report is in $(BUILD_COV_DIR)/html/index.html"
@echo
@echo "Build finished. Code coverage report is in $(BUILD_COV_DIR)/html/index.html"
+.PHONY: wipe-cov
+
wipe-cov: wipe
@rm -rf $(BUILD_COV_DIR)
wipe-cov: wipe
@rm -rf $(BUILD_COV_DIR)