From: Prarit Bhargava <prarit(a)redhat.com>
redhat/self-test: Add test to verify Makefile declarations.
The Makefiles have been organized such that only Makefile.variables
contain external variables that can be set on the command line, and
the Makefile only contains variables that can set within the Makefile
itself.
Add a test to verify these Makefile declarations.
Signed-off-by: Prarit Bhargava <prarit(a)redhat.com>
diff --git a/redhat/self-test/3001-Makefile-contents.bats
b/redhat/self-test/3001-Makefile-contents.bats
new file mode 100755
index blahblah..blahblah 100755
--- /dev/null
+++ b/redhat/self-test/3001-Makefile-contents.bats
@@ -0,0 +1,17 @@
+#!/usr/bin/env bats
+
+@test "Makefile variable declarations" {
+ # By design, only the Makefile.variables file should have ?= declarations
+
+ value=$(git grep "?=" Makefile.variables | wc -l)
+ if [ $value -eq 0 ]; then
+ echo "Test failed: No ?= variables found in Makefile.variables"
+ exit 1
+ fi
+
+ value=$(git grep "?=" Makefile | wc -l)
+ if [ $value -gt 0 ]; then
+ echo "Test failed: Makefile should not ?= declarations."
+ exit 1
+ fi
+}
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1728