From 7a745e4084fb62a104a70c426563b62b3e2df1e2 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 4 Dec 2020 17:06:01 +0100 Subject: [PATCH] Makefile: use pytest for nicer output Also prepare to actually use the pytest module from the tests. --- Makefile | 32 ++++++++++++++------------------ README.md | 4 ++++ requirements.txt | 1 + 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 91a21565..91be8d95 100644 --- a/Makefile +++ b/Makefile @@ -223,35 +223,31 @@ test-data: $(TEST_MANIFESTS_GEN) .PHONY: test-module test-module: - @$(PYTHON3) -m unittest \ - discover \ - --start=$(SRCDIR)/test/mod \ - --top-level-directory=$(SRCDIR) \ + @$(PYTHON3) -m pytest \ + $(SRCDIR)/test/mod \ + --rootdir=$(SRCDIR) \ -v -.PHONY: test-runtime +.PHONY: test-run test-run: @[[ $${EUID} -eq 0 ]] || (echo "Error: Root privileges required!"; exit 1) - @$(PYTHON3) -m unittest \ - discover \ - --start=$(SRCDIR)/test/run \ - --top-level-directory=$(SRCDIR) \ + @$(PYTHON3) -m pytest \ + $(SRCDIR)/test/run \ + --rootdir=$(SRCDIR) \ -v .PHONY: test-src test-src: - @$(PYTHON3) -m unittest \ - discover \ - --start=$(SRCDIR)/test/src \ - --top-level-directory=$(SRCDIR) \ + @$(PYTHON3) -m pytest \ + $(SRCDIR)/test/src \ + --rootdir=$(SRCDIR) \ -v -.PHONY: test +.PHONY: test-all test-all: - @$(PYTHON3) -m unittest \ - discover \ - --start=$(SRCDIR)/test \ - --top-level-directory=$(SRCDIR) \ + @$(PYTHON3) -m pytest \ + $(SRCDIR)/test \ + --rootdir=$(SRCDIR) \ -v # diff --git a/README.md b/README.md index 13304e5f..b612f613 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ At build-time, the following software is required: * `python-docutils >= 0.13` * `pkg-config >= 0.29` +Testing requires additional software: + + * `pytest` + ### Build The standard python package system is used. Consult upstream documentation for diff --git a/requirements.txt b/requirements.txt index d89304b1..598596ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ jsonschema +pytest