diff mbox series

[nft,v2,2/5] build: add `make check-build` to run `./tests/build/run-tests.sh`

Message ID 20231105150955.349966-3-thaller@redhat.com
State New
Headers show
Series add infrastructure for unit tests | expand

Commit Message

Thomas Haller Nov. 5, 2023, 3:08 p.m. UTC
`./tests/build/run-tests.sh` performs a build check. Integrate it in
make as `make check-build` target.

`make check-build` is hooked into `make check-more`, which in turn is
hooked as `make check-all`.

Note that this is intentionally not part of `make check`, because `make
check` is run by `make distcheck`, and the build test itself calls `make
distcheck`. Even if that cycle would be resolved, doing a build check
several times during `make check` seems wrong and would add another
minute to the test runtime.

Signed-off-by: Thomas Haller <thaller@redhat.com>
---
 Makefile.am | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/Makefile.am b/Makefile.am
index 93bd47970077..6a0b04641afc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -421,6 +421,14 @@  build-all: all $(check_PROGRAMS) $(check_LTLIBRARIES)
 
 ###############################################################################
 
+check-build: build-all
+	cd "$(srcdir)/tests/build/" ; \
+	CC="$(CC)" CFLAGS='-Werror' ./run-tests.sh
+
+check_more += check-build
+
+###############################################################################
+
 check-local: build-all $(check_local)
 
 .PHONY: check-local $(check_local)