This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=1e9c98a43156b1724e8a1de2d63556c432bd8b7e

commit 1e9c98a43156b1724e8a1de2d63556c432bd8b7e
Author: Guillem Jover <[email protected]>
AuthorDate: Mon Jul 1 05:32:11 2024 +0200

    test: Parametrize all Makefile fragment functional tests
    
    Switch the tests to use variable lists instead of testing each variable
    individually. This will make extending and adding comments to identify
    the variables being tested easier and with less repetition.
---
 scripts/t/mk/buildapi.mk  | 12 ++++++++++--
 scripts/t/mk/buildopts.mk | 10 ++++++++--
 scripts/t/mk/pkg-info.mk  | 29 +++++++++++++++++++++--------
 scripts/t/mk/vendor.mk    | 15 ++++++++++++---
 4 files changed, 51 insertions(+), 15 deletions(-)

diff --git a/scripts/t/mk/buildapi.mk b/scripts/t/mk/buildapi.mk
index 96269bcff..08ff17e51 100644
--- a/scripts/t/mk/buildapi.mk
+++ b/scripts/t/mk/buildapi.mk
@@ -1,4 +1,12 @@
 include $(srcdir)/mk/buildapi.mk
 
-test:
-       test "$(DPKG_BUILD_API)" = "0"
+TEST_DPKG_BUILD_API = 0
+
+test_vars := \
+  DPKG_BUILD_API \
+  # EOL
+
+test: $(test_vars)
+
+$(test_vars):
+       test '$($@)' = '$(TEST_$@)'
diff --git a/scripts/t/mk/buildopts.mk b/scripts/t/mk/buildopts.mk
index 46d0efad0..eaf156346 100644
--- a/scripts/t/mk/buildopts.mk
+++ b/scripts/t/mk/buildopts.mk
@@ -1,4 +1,10 @@
 include $(srcdir)/mk/buildopts.mk
 
-test:
-       test "$(DEB_BUILD_OPTION_PARALLEL)" = 
"$(TEST_DEB_BUILD_OPTION_PARALLEL)"
+test_vars := \
+  DEB_BUILD_OPTION_PARALLEL \
+  # EOL
+
+test: $(test_vars)
+
+$(test_vars):
+       test '$($@)' = '$(TEST_$@)'
diff --git a/scripts/t/mk/pkg-info.mk b/scripts/t/mk/pkg-info.mk
index c0e3287b5..bd578c06c 100644
--- a/scripts/t/mk/pkg-info.mk
+++ b/scripts/t/mk/pkg-info.mk
@@ -1,11 +1,24 @@
 include $(srcdir)/mk/pkg-info.mk
 
-test:
-       test "$(DEB_SOURCE)" = "source"
-       test "$(DEB_VERSION)" = "1:2:3.4-5-6"
-       test "$(DEB_VERSION_EPOCH_UPSTREAM)" = "1:2:3.4-5"
-       test "$(DEB_VERSION_UPSTREAM_REVISION)" = "2:3.4-5-6"
-       test "$(DEB_VERSION_UPSTREAM)" = "2:3.4-5"
-       test "$(DEB_DISTRIBUTION)" = "suite"
-       test '$(SOURCE_DATE_EPOCH)' = '$(TEST_SOURCE_DATE_EPOCH)'
+TEST_DEB_SOURCE = source
+TEST_DEB_VERSION = 1:2:3.4-5-6
+TEST_DEB_VERSION_EPOCH_UPSTREAM = 1:2:3.4-5
+TEST_DEB_VERSION_UPSTREAM_REVISION = 2:3.4-5-6
+TEST_DEB_VERSION_UPSTREAM = 2:3.4-5
+TEST_DEB_DISTRIBUTION = suite
+
+test_vars := \
+  DEB_SOURCE \
+  DEB_VERSION \
+  DEB_VERSION_EPOCH_UPSTREAM \
+  DEB_VERSION_UPSTREAM_REVISION \
+  DEB_VERSION_UPSTREAM \
+  DEB_DISTRIBUTION \
+  SOURCE_DATE_EPOCH \
+  # EOL
+
+test: $(test_vars)
        test "$${SOURCE_DATE_EPOCH}" = '$(TEST_SOURCE_DATE_EPOCH)'
+
+$(test_vars):
+       test '$($@)' = '$(TEST_$@)'
diff --git a/scripts/t/mk/vendor.mk b/scripts/t/mk/vendor.mk
index 4e0d9ff89..b77e88aba 100644
--- a/scripts/t/mk/vendor.mk
+++ b/scripts/t/mk/vendor.mk
@@ -1,6 +1,15 @@
 include $(srcdir)/mk/vendor.mk
 
-test:
-       test "$(DEB_VENDOR)" = "Debian"
-       test "$(DEB_PARENT_VENDOR)" = ""
+TEST_DEB_VENDOR = Debian
+TEST_DEB_PARENT_VENDOR =
+
+test_vars := \
+  DEB_VENDOR \
+  DEB_PARENT_VENDOR \
+  # EOL
+
+test: $(test_vars)
        test "$(shell $(call dpkg_vendor_derives_from,debian))" = "yes"
+
+$(test_vars):
+       test '$($@)' = '$(TEST_$@)'

-- 
Dpkg.Org's dpkg

Reply via email to