build: enable unit tests as part of build

Enabling the unit tests as part of the pip and debian builds.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
This commit is contained in:
Ray Kinsella
2022-07-13 12:57:57 +01:00
parent fff10dba02
commit f5c31c7f39
3 changed files with 6 additions and 3 deletions

View File

@ -8,6 +8,7 @@ WIPE=dist $(VPPCFG).egg-info .pybuild debian/vppcfg debian/vppcfg.*.log
WIPE+=debian/vppcfg.*.debhelper debian/.debhelper debian/files WIPE+=debian/vppcfg.*.debhelper debian/.debhelper debian/files
WIPE+=debian/vppcfg.substvars WIPE+=debian/vppcfg.substvars
WHL_INSTALL=dist/$(VPPCFG)-$(VERSION)-py3-none-any.whl WHL_INSTALL=dist/$(VPPCFG)-$(VERSION)-py3-none-any.whl
TESTS=$(VPPCFG)/tests.py
.PHONY: build .PHONY: build
build: build:
@ -29,6 +30,10 @@ pkg-deb:
check-style: check-style:
PYTHONPATH=./$(VPPCFG) pylint ./$(VPPCFG) PYTHONPATH=./$(VPPCFG) pylint ./$(VPPCFG)
.PHONY: test
test:
PYTHONPATH=./$(VPPCFG) $(PYTHON) $(TESTS)
.PHONY: uninstall .PHONY: uninstall
uninstall: uninstall:
sudo $(PIP) uninstall $(VPPCFG) sudo $(PIP) uninstall $(VPPCFG)

3
debian/rules vendored
View File

@ -2,6 +2,3 @@
%: %:
dh $@ --with python3 --buildsystem=pybuild --with systemd dh $@ --with python3 --buildsystem=pybuild --with systemd
# TODO: fix test.py to that unit tests can be automagically called.
override_dh_auto_test:

View File

@ -18,5 +18,6 @@ setup(
"vppcfg = vppcfg.vppcfg:main", "vppcfg = vppcfg.vppcfg:main",
] ]
}, },
test_suite="vppcfg.config",
package_data={"vppcfg": ["*.yaml"]}, package_data={"vppcfg": ["*.yaml"]},
) )