From cf9383412494964d6188fcf08a362c0c0f313afc Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 26 Nov 2019 14:11:14 +0300 Subject: Import perl (5.30.0-9) --- debian/t/released-versions.t | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 debian/t/released-versions.t (limited to 'debian/t/released-versions.t') 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 (

) { + 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, ") { + chomp; + $found++,last if $_ eq $upstream_version; + } + close C; + ok($found, "found version $upstream_version in debian/released-versions"); +} -- cgit v1.2.3