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=a0cc008c902b2b4cf812eb60235c7c4cbc329770

commit a0cc008c902b2b4cf812eb60235c7c4cbc329770
Author: Nicolas Boulenguez <[email protected]>
AuthorDate: Thu Feb 11 15:36:15 2021 +0100

    test: Add test case for SOURCE_DATE_EPOCH
    
    Set SOURCE_DATE_EPOCH either from the environment or the Debian changelog.
    Check that the value is (re)exported.
    
    [[email protected]: Hardcode the timestamp instead of forking date(1). ]
    
    Signed-off-by: Guillem Jover <[email protected]>
---
 scripts/t/mk.t           | 10 +++++++++-
 scripts/t/mk/pkg-info.mk |  2 ++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/t/mk.t b/scripts/t/mk.t
index 10e030a16..ea733e1f9 100644
--- a/scripts/t/mk.t
+++ b/scripts/t/mk.t
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 10;
+use Test::More tests => 11;
 use Test::Dpkg qw(:paths);
 
 use File::Spec::Functions qw(rel2abs);
@@ -131,6 +131,14 @@ foreach my $tool (keys %buildtools) {
     delete $ENV{"${tool}_FOR_BUILD"};
 }
 
+delete $ENV{SOURCE_DATE_EPOCH};
+# Timestamp in seconds since the epoch from date in test debian/changelog
+# entry: «Tue, 04 Aug 2015 16:13:50 +0200».
+$ENV{TEST_SOURCE_DATE_EPOCH} = 1438697630;
+test_makefile('pkg-info.mk');
+
+$ENV{SOURCE_DATE_EPOCH} = 100;
+$ENV{TEST_SOURCE_DATE_EPOCH} = 100;
 test_makefile('pkg-info.mk');
 
 test_makefile('vendor.mk');
diff --git a/scripts/t/mk/pkg-info.mk b/scripts/t/mk/pkg-info.mk
index 22a2bf44f..c0e3287b5 100644
--- a/scripts/t/mk/pkg-info.mk
+++ b/scripts/t/mk/pkg-info.mk
@@ -7,3 +7,5 @@ test:
        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 "$${SOURCE_DATE_EPOCH}" = '$(TEST_SOURCE_DATE_EPOCH)'

-- 
Dpkg.Org's dpkg

Reply via email to