add vpp debugging support to test framework
[vpp.git] / test / Makefile
1 .PHONY: verify-python-path
2
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
9
10 test: wipe verify-python-path
11         @virtualenv $(PYTHON_VENV_PATH)
12         @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install scapy"
13         @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install pexpect"
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
17 retest: wipe verify-python-path
18         @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && python run_tests.py discover -p test_$(TEST)\"*.py\""
19
20 .PHONY: wipe doc
21
22 wipe: verify-python-path
23         @rm -f /dev/shm/vpp-unittest-*
24         @rm -rf /tmp/vpp-unittest-*
25
26 doc: verify-python-path
27         @virtualenv $(PYTHON_VENV_PATH)
28         @bash -c "source $(PYTHON_VENV_PATH)/bin/activate && pip install sphinx"
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 ""