From 6d5ca96e4f401b446b2e9490b6d24de5e639880c Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 23 Sep 2020 12:52:46 +0200 Subject: Add verify-bindings make target This patch adds the verify-bindings make target that re-generates the bindings using bindgen and verifies that they do not differ from the pre-generated bindings in the Git repository. --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b0b5bba..0f4c371 100644 --- a/Makefile +++ b/Makefile @@ -14,3 +14,12 @@ src/ffi.rs: ${LIBNITROKEY}/NK_C_API.h "$<" \ -- "-I${LIBNITROKEY}/libnitrokey" quilt push -a --refresh + +.PHONY: verify-bindings +verify-bindings: + @git diff --exit-code src/ffi.rs || \ + (echo "This test can only be executed on a clean working tree"; exit 1) + @$(MAKE) --always-make src/ffi.rs > /dev/null + @git diff --exit-code src/ffi.rs && \ + (echo "The generated bindings have been verified successfully!") || \ + (echo "Error: The generated bindings differ from the pre-generated bindings!"; exit 1) -- cgit v1.2.1