[OS-BUILD PATCH 18/18] redhat/self-test: Add test to verify Makefile declarations.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prarit Bhargava <prarit@xxxxxxxxxx>

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@xxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux