diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2019-11-26 14:11:14 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2019-11-26 14:11:14 +0300 |
commit | cf9383412494964d6188fcf08a362c0c0f313afc (patch) | |
tree | bd9e6a5b3a63cbb155b81112c855c19cb5f2b314 /debian/t/released-versions.t | |
download | perl-cf9383412494964d6188fcf08a362c0c0f313afc.tar.gz |
Import perl (5.30.0-9)debian/5.30.0-9debian
Diffstat (limited to 'debian/t/released-versions.t')
-rwxr-xr-x | debian/t/released-versions.t | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/t/released-versions.t b/debian/t/released-versions.t new file mode 100755 index 0000000..6251821 --- /dev/null +++ b/debian/t/released-versions.t @@ -0,0 +1,36 @@ +#!/usr/bin/perl -w +use strict; +use Test::More tests => 6; + +# Test that the current upstream version is listed in debian/released-versions +# for uploads targetting unstable. +# +# Forgetting this will only cause problems if/when the next minor release is +# uploaded, at which point it will be missing perlapi-5.xx.x for this version. +# Running this check from autopkgtest should therefore pinpoint such issues +# well in advance. + +my $upstream_version; +my $distribution; +ok(open(P, "dpkg-parsechangelog |"), "successfully piping from dpkg-parsechangelog"); +while (<P>) { + chomp; + /^Version: (.+)-[^-]+$/ and $upstream_version = $1; + /^Distribution: (.+)+$/ and $distribution = $1; +} +ok(close P, "dpkg-parsechangelog exited normally"); +ok(defined $upstream_version, "found upstream version from dpkg-parsechangelog output"); +ok(defined $distribution, "found distribution information from dpkg-parsechangelog output"); + +SKIP: { + skip("Only checking debian/released-versions for unstable (not $distribution)", 2) + if $distribution ne 'unstable'; + my $found=0; + ok(open(C, "<debian/released-versions"), "successfully opened debian/released-versions"); + while (<C>) { + chomp; + $found++,last if $_ eq $upstream_version; + } + close C; + ok($found, "found version $upstream_version in debian/released-versions"); +} |