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

[lintian] 02/02: ancient-sv-date.t: allow a time diff up to +/- 2month



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

nthykier pushed a commit to branch master
in repository lintian.

commit 3edc82f52b0e5e57f630ed2df73e7da0a4925cd8
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Apr 2 12:17:21 2016 +0000

    ancient-sv-date.t: allow a time diff up to +/- 2month
    
    Which means we now only have to update the
    data/standards-version/ancient-date once every ~4 month.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 data/standards-version/ancient-date | 2 +-
 t/scripts/ancient-sv-date.t         | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/data/standards-version/ancient-date b/data/standards-version/ancient-date
index ec7ba43..a49a64e 100644
--- a/data/standards-version/ancient-date
+++ b/data/standards-version/ancient-date
@@ -1,5 +1,5 @@
 # Any Standards Version released before this day is "ancient"
-# That date has to be within 22 and 24 months in the past
+# That date has to be within 22 and 26 months in the past
 # at release time
 # Format is ANCIENT < Date
 ANCIENT < 20 Feb 2014
diff --git a/t/scripts/ancient-sv-date.t b/t/scripts/ancient-sv-date.t
index 3f47a99..8cfecda 100755
--- a/t/scripts/ancient-sv-date.t
+++ b/t/scripts/ancient-sv-date.t
@@ -11,8 +11,8 @@ use autodie;
 use Test::More;
 
 # How much out of date the check may be; measured in seconds
-# 1 month
-use constant ERROR_MARGIN => 3600 * 24 * 31;
+# 2 months
+use constant ERROR_MARGIN => 3600 * 24 * 31 * 2;
 # How long before a SV is considered "Ancient" in seconds.
 # 2 years.
 use constant ANCIENT_AGE  => 3600 * 24 * 365 * 2;
@@ -47,7 +47,8 @@ while (my $line = <$fd>) {
           or die "Cannot parse date ($date, line $.): $!";
         my $time = time - ANCIENT_AGE;
         $found = 1;
-        cmp_ok($time, '<', $and + ERROR_MARGIN, 'ANCIENT_DATE is up to date');
+        cmp_ok($time, '<', $and + ERROR_MARGIN, 'ANCIENT_DATE is up to date')
+          or diag(' * Please update data/standards-version/ancient-date');
         cmp_ok(
             $time, '>',
             $and - ERROR_MARGIN,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: