Klement Sekera | 277b89c | 2016-10-28 13:20:27 +0200 | [diff] [blame] | 1 | .PHONY: verify-python-path |
Damjan Marion | f56b77a | 2016-10-03 19:44:57 +0200 | [diff] [blame] | 2 | |
Klement Sekera | 277b89c | 2016-10-28 13:20:27 +0200 | [diff] [blame] | 3 | verify-python-path: |
| 4 | ifndef VPP_PYTHON_PREFIX |
| 5 | $(error VPP_PYTHON_PREFIX is not set) |
| 6 | endif |
| 7 | |
| 8 | PYTHON_VENV_PATH=$(VPP_PYTHON_PREFIX)/virtualenv |
Klement Sekera | 778c276 | 2016-11-08 02:00:28 +0100 | [diff] [blame^] | 9 | PYTHON_DEPENDS=scapy pexpect |
Klement Sekera | 277b89c | 2016-10-28 13:20:27 +0200 | [diff] [blame] | 10 | |
| 11 | test: wipe verify-python-path |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 12 | @virtualenv $(PYTHON_VENV_PATH) |
Klement Sekera | 778c276 | 2016-11-08 02:00:28 +0100 | [diff] [blame^] | 13 | @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS)" |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 14 | @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 Sekera | 277b89c | 2016-10-28 13:20:27 +0200 | [diff] [blame] | 17 | retest: wipe verify-python-path |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 18 | @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\"" |
| 19 | |
Klement Sekera | 277b89c | 2016-10-28 13:20:27 +0200 | [diff] [blame] | 20 | .PHONY: wipe doc |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 21 | |
Klement Sekera | 778c276 | 2016-11-08 02:00:28 +0100 | [diff] [blame^] | 22 | wipe: |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 23 | @rm -f /dev/shm/vpp-unittest-* |
| 24 | @rm -rf /tmp/vpp-unittest-* |
| 25 | |
Klement Sekera | 277b89c | 2016-10-28 13:20:27 +0200 | [diff] [blame] | 26 | doc: verify-python-path |
Klement Sekera | f62ae12 | 2016-10-11 11:47:09 +0200 | [diff] [blame] | 27 | @virtualenv $(PYTHON_VENV_PATH) |
Klement Sekera | 778c276 | 2016-11-08 02:00:28 +0100 | [diff] [blame^] | 28 | @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install $(PYTHON_DEPENDS) sphinx" |
Klement Sekera | 277b89c | 2016-10-28 13:20:27 +0200 | [diff] [blame] | 29 | @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && make -C doc WS_ROOT=$(WS_ROOT) BR=$(BR) NO_VPP_PAPI=1 html" |
| 30 | |
| 31 | wipe-doc: |
| 32 | @make -C doc wipe BR=$(BR) |
| 33 | |
| 34 | help: |
| 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 "" |