blob: aac637d3e5fb853545d952eb4d1c9ce485592172 [file] [log] [blame]
Klement Sekera277b89c2016-10-28 13:20:27 +02001.PHONY: verify-python-path
Damjan Marionf56b77a2016-10-03 19:44:57 +02002
Klement Sekera277b89c2016-10-28 13:20:27 +02003verify-python-path:
4ifndef VPP_PYTHON_PREFIX
5 $(error VPP_PYTHON_PREFIX is not set)
6endif
7
8PYTHON_VENV_PATH=$(VPP_PYTHON_PREFIX)/virtualenv
Klement Sekera778c2762016-11-08 02:00:28 +01009PYTHON_DEPENDS=scapy pexpect
Klement Sekera277b89c2016-10-28 13:20:27 +020010
11test: wipe verify-python-path
Klement Sekeraf62ae122016-10-11 11:47:09 +020012 @virtualenv $(PYTHON_VENV_PATH)
Klement Sekera778c2762016-11-08 02:00:28 +010013 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS)"
Klement Sekeraf62ae122016-10-11 11:47:09 +020014 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && cd $(WS_ROOT)/vpp-api/python && python setup.py install"
15 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\""
16
Klement Sekera277b89c2016-10-28 13:20:27 +020017retest: wipe verify-python-path
Klement Sekeraf62ae122016-10-11 11:47:09 +020018 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\""
19
Klement Sekera277b89c2016-10-28 13:20:27 +020020.PHONY: wipe doc
Klement Sekeraf62ae122016-10-11 11:47:09 +020021
Klement Sekera778c2762016-11-08 02:00:28 +010022wipe:
Klement Sekeraf62ae122016-10-11 11:47:09 +020023 @rm -f /dev/shm/vpp-unittest-*
24 @rm -rf /tmp/vpp-unittest-*
25
Klement Sekera277b89c2016-10-28 13:20:27 +020026doc: verify-python-path
Klement Sekeraf62ae122016-10-11 11:47:09 +020027 @virtualenv $(PYTHON_VENV_PATH)
Klement Sekera778c2762016-11-08 02:00:28 +010028 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS) sphinx"
Klement Sekera277b89c2016-10-28 13:20:27 +020029 @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && make -C doc WS_ROOT=$(WS_ROOT) BR=$(BR) NO_VPP_PAPI=1 html"
30
31wipe-doc:
32 @make -C doc wipe BR=$(BR)
33
34help:
35 @echo "Running tests:"
36 @echo ""
37 @echo " test - build and run functional tests"
38 @echo " test-debug - build and run functional tests (debug build)"
39 @echo " retest - run functional tests"
40 @echo " retest-debug - run functional tests (debug build)"
41 @echo " wipe-test - wipe (temporary) files generated by unit tests"
42 @echo ""
43 @echo "Arguments controlling test runs:"
44 @echo " V=[0|1|2] - set test verbosity level"
45 @echo " DEBUG=<type> - set VPP debugging kind"
46 @echo " DEBUG=core - detect coredump and load it in gdb on crash"
47 @echo " DEBUG=gdb - allow easy debugging by printing VPP PID "
48 @echo " and waiting for user input before running "
49 @echo " and tearing down a testcase"
50 @echo " DEBUG=gdbserver - run gdb inside a gdb server, otherwise "
51 @echo " same as above"
52 @echo " STEP=[yes|no] - ease debugging by stepping through a testcase "
53 @echo " TEST=<name> - only run specific test"
54 @echo ""
55 @echo "Creating test documentation"
56 @echo " test-doc - generate documentation for test framework"
57 @echo " wipe-test-doc - wipe documentation for test framework"
58 @echo ""