From f5c31c7f396a71b2d6a450cde8333be952a421aa Mon Sep 17 00:00:00 2001 From: Ray Kinsella Date: Wed, 13 Jul 2022 12:57:57 +0100 Subject: [PATCH] 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 --- Makefile | 5 +++++ debian/rules | 3 --- setup.py | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7d8deac..6db684b 100644 --- a/Makefile +++ b/Makefile @@ -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.substvars WHL_INSTALL=dist/$(VPPCFG)-$(VERSION)-py3-none-any.whl +TESTS=$(VPPCFG)/tests.py .PHONY: build build: @@ -29,6 +30,10 @@ pkg-deb: check-style: PYTHONPATH=./$(VPPCFG) pylint ./$(VPPCFG) +.PHONY: test +test: + PYTHONPATH=./$(VPPCFG) $(PYTHON) $(TESTS) + .PHONY: uninstall uninstall: sudo $(PIP) uninstall $(VPPCFG) diff --git a/debian/rules b/debian/rules index c2e1c4b..1a1d12e 100755 --- a/debian/rules +++ b/debian/rules @@ -2,6 +2,3 @@ %: dh $@ --with python3 --buildsystem=pybuild --with systemd - -# TODO: fix test.py to that unit tests can be automagically called. -override_dh_auto_test: diff --git a/setup.py b/setup.py index 533e9df..0abf4f2 100644 --- a/setup.py +++ b/setup.py @@ -18,5 +18,6 @@ setup( "vppcfg = vppcfg.vppcfg:main", ] }, + test_suite="vppcfg.config", package_data={"vppcfg": ["*.yaml"]}, )