From: Prarit Bhargava <pra...@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 <pra...@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
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/kernel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to