Tests: Add automated testing framework with coverage support

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Pragyansh Chaturvedi
2026-03-30 16:12:57 +05:30
parent 0498885f71
commit da57911122
12 changed files with 425 additions and 2 deletions

View File

@ -1,10 +1,22 @@
install:
pip install -e .
uv pip install -e ".[test]"
clean:
rm -rf build dist *.egg-info
rm -rf examples/*.ll examples/*.o
rm -rf htmlcov .coverage
test:
pytest tests/ -v --tb=short -m "not verifier"
test-cov:
pytest tests/ -v --tb=short -m "not verifier" \
--cov=pythonbpf --cov-report=term-missing --cov-report=html
test-verifier:
@echo "NOTE: verifier tests require sudo and bpftool. Uses sudo .venv/bin/python3."
pytest tests/test_verifier.py -v --tb=short -m verifier
all: clean install
.PHONY: all clean
.PHONY: all clean install test test-cov test-verifier