From 774e54c8927088c60617dc9345f55eaabb23256a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 20:40:28 +0200 Subject: Adding upstream version 1.22.5. Signed-off-by: Daniel Baumann --- scripts/t/Dpkg_BuildFlags.t | 117 +++++++++++++++++++++++++++++++++++++++++++- scripts/t/Dpkg_OpenPGP.t | 1 + 2 files changed, 117 insertions(+), 1 deletion(-) (limited to 'scripts/t') diff --git a/scripts/t/Dpkg_BuildFlags.t b/scripts/t/Dpkg_BuildFlags.t index 530871c..515ed15 100644 --- a/scripts/t/Dpkg_BuildFlags.t +++ b/scripts/t/Dpkg_BuildFlags.t @@ -16,7 +16,7 @@ use strict; use warnings; -use Test::More tests => 40; +use Test::More tests => 100; BEGIN { $ENV{DEB_BUILD_ARCH} = 'amd64'; @@ -171,4 +171,119 @@ $ENV{DEB_BUILD_MAINT_OPTIONS} = 'future=+lfs abi=-lfs'; $bf = Dpkg::BuildFlags->new(); test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +# Test time64 abi features, for a 64-bit system, a 32-bit system with time64 +# and a 32-bit system with time32. + +# 32-bit system with time32, time64 not enabled by default. +$ENV{DEB_BUILD_ARCH} = 'i386'; +$ENV{DEB_HOST_ARCH} = 'i386'; + +undef $ENV{DEB_BUILD_MAINT_OPTIONS}; +$bf = Dpkg::BuildFlags->new(); +test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_noflag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_noflag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +$ENV{DEB_BUILD_MAINT_OPTIONS} = 'abi=+time64'; +$bf = Dpkg::BuildFlags->new(); +test_has_flag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_flag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_flag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +$ENV{DEB_BUILD_MAINT_OPTIONS} = 'abi=-time64'; +$bf = Dpkg::BuildFlags->new(); +test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_noflag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_noflag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +# 32-bit system with time32 and no time64. +$ENV{DEB_BUILD_ARCH} = 'hurd-i386'; +$ENV{DEB_HOST_ARCH} = 'hurd-i386'; + +undef $ENV{DEB_BUILD_MAINT_OPTIONS}; +$bf = Dpkg::BuildFlags->new(); +test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_noflag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_noflag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +$ENV{DEB_BUILD_MAINT_OPTIONS} = 'abi=+time64'; +$bf = Dpkg::BuildFlags->new(); +test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_noflag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_noflag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +$ENV{DEB_BUILD_MAINT_OPTIONS} = 'abi=-time64'; +$bf = Dpkg::BuildFlags->new(); +test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_noflag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_noflag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +# 32-bit system with time32, time64 enabled by default. +$ENV{DEB_BUILD_ARCH} = 'armhf'; +$ENV{DEB_HOST_ARCH} = 'armhf'; + +undef $ENV{DEB_BUILD_MAINT_OPTIONS}; +$bf = Dpkg::BuildFlags->new(); +test_has_flag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_flag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_flag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +$ENV{DEB_BUILD_MAINT_OPTIONS} = 'abi=+time64'; +$bf = Dpkg::BuildFlags->new(); +test_has_flag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_flag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_flag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +$ENV{DEB_BUILD_MAINT_OPTIONS} = 'abi=-time64'; +$bf = Dpkg::BuildFlags->new(); +test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_flag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_noflag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_flag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_noflag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +# 64-bit system with built-in time64. +$ENV{DEB_BUILD_ARCH} = 'amd64'; +$ENV{DEB_HOST_ARCH} = 'amd64'; + +undef $ENV{DEB_BUILD_MAINT_OPTIONS}; +$bf = Dpkg::BuildFlags->new(); +test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_noflag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_noflag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +$ENV{DEB_BUILD_MAINT_OPTIONS} = 'abi=+time64'; +$bf = Dpkg::BuildFlags->new(); +test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_noflag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_noflag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + +$ENV{DEB_BUILD_MAINT_OPTIONS} = 'abi=-time64'; +$bf = Dpkg::BuildFlags->new(); +test_has_noflag($bf, 'CPPFLAGS', '-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_LARGEFILE_SOURCE -U_FILE_OFFSET_BITS'); +test_has_noflag($bf, 'CPPFLAGS', '-D_TIME_BITS=64'); +test_has_noflag($bf, 'CPPFLAGS', '-U_TIME_BITS'); +test_has_noflag($bf, 'CFLAGS', '-Werror=implicit-function-declaration'); + # TODO: Add more test cases. diff --git a/scripts/t/Dpkg_OpenPGP.t b/scripts/t/Dpkg_OpenPGP.t index c3cd724..d409082 100644 --- a/scripts/t/Dpkg_OpenPGP.t +++ b/scripts/t/Dpkg_OpenPGP.t @@ -27,6 +27,7 @@ use Dpkg::OpenPGP::KeyHandle; my %backend_cmd = ( auto => 'auto', + 'gpg-sq' => 'gpg', gpg => 'gpg', sq => 'sq', sqop => 'sop', -- cgit v1.2.3