1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
|
#
# This file is part of Config-Model
#
# This software is Copyright (c) 2012 by Dominique Dumont, Krzysztof Tyszecki.
#
# This is free software, licensed under:
#
# The GNU Lesser General Public License, Version 2.1, February 1999
#
use Data::Dumper;
use IO::File;
$conf_file_name = "control";
$conf_dir = 'debian';
$model_to_test = "Debian::Dpkg::Control";
eval { require AptPkg::Config ;} ;
$skip = ( $@ or not -r '/etc/debian_version') ? 1 : 0 ;
my $t3_description = "This is an extension of Dist::Zilla::Plugin::InlineFiles,
providing the following file:
- xt/release/pod-spell.t - a standard Test::Spelling test" ;
@tests = (
{
# t0
check => {
'source Source', "libdist-zilla-plugins-cjm-perl",
'source Build-Depends:0', "debhelper (>= 7)",
'source Build-Depends-Indep:0', "libcpan-meta-perl | perl (>= 5.13.10)", # fixed
'source Build-Depends-Indep:1', "libdist-zilla-perl", # fixed
'source Build-Depends-Indep:5', "libpath-class-perl",
'source Build-Depends-Indep:6', "perl (>= 5.11.3) | libmodule-build-perl (>= 0.36)", # fixed
'binary:libdist-zilla-plugins-cjm-perl Depends:0',
'${misc:Depends}',
'source Vcs-Browser' ,'http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libdist-zilla-plugins-cjm-perl.git',
'source Vcs-Git', 'git://git.debian.org/pkg-perl/packages/libdist-zilla-plugins-cjm-perl.git',
},
load_warnings => [ qr/dependency/, qr/dual life/, (qr/dependency/) x 2,
qr/libmodule-build-perl \(>= 0.36\) \| perl \(>= 5.8.8\)/,
qr/should be 'perl \(>= 5.11.3\) \| libmodule-build-perl \(>= 0.36\)/,
qr/standards version/,
qr/dependency/, qr/dual life/, (qr/dependency/) x 2 ],
apply_fix => 1,
},
{
# t1
check => { 'binary:seaview Recommends:0', 'clustalw', },
load_warnings => [ qr/dependency is deprecated/,qr/standards version/, qr/too long/ ],
apply_fix => 1,
load => 'binary:seaview Synopsis="multiplatform interface for sequence alignment"',
},
{
# t2
check => {
'binary:xserver-xorg-video-all Architecture',
'any',
'binary:xserver-xorg-video-all Depends:0',
'${F:XServer-Xorg-Video-Depends}',
'binary:xserver-xorg-video-all Depends:1',
'${misc:Depends}',
'binary:xserver-xorg-video-all Replaces:0',
'xserver-xorg-driver-all',
'binary:xserver-xorg-video-all Conflicts:0',
'xserver-xorg-driver-all',
},
apply_fix => 1,
load_warnings => undef, #skipped
dump_warnings => undef, #skipped
no_warnings => 1,
},
{
# t3
check => {
# no longer mess up synopsis with lcfirst
'binary:libdist-zilla-plugin-podspellingtests-perl Synopsis' =>
"Release tests for POD spelling",
'binary:libdist-zilla-plugin-podspellingtests-perl Description' => $t3_description ,
},
load_warnings => [ qr/standards version/, (qr/value/) x 2],
load => 'binary:libdist-zilla-plugin-podspellingtests-perl '.
'Description="'.$t3_description.'"',
apply_fix => 1,
},
{
# t4
check => { 'source X-Python-Version' => ">= 2.3, << 2.5" },
load_warnings => [ (qr/deprecated/) x 2, qr/empty/ ],
# dump_warnings => [ qr/empty/ ],
},
{
# t5
check => { 'source X-Python-Version' => ">= 2.3, << 2.6" },
load_warnings => [ (qr/deprecated/) x 2, qr/empty/ ],
# dump_warnings => [ qr/empty/ ],
},
{
# t6
check => { 'source X-Python-Version' => ">= 2.3" },
load_warnings => [ (qr/deprecated/) x 2, qr/empty/ ],
# dump_warnings => [ qr/empty/ ],
},
{
name => 'sdlperl',
load => 'source Uploaders:2="Sam Hocevar (Debian packages) <sam@zoy.org>"',
load_warnings => [ ( qr/Warning/) x 6 ],
load_check => 'no',
apply_fix => 1,
},
{
name => 'libpango-perl',
load_warnings => [ ( qr/Warning/) x 2 ],
verify_annotation => {
'source Build-Depends' => "do NOT add libgtk2-perl to build-deps (see bug #554704)",
'source Maintainer' => "what a fine\nteam this one is",
},
load_check => 'no',
apply_fix => 1,
},
{
name => 'libwx-scintilla-perl',
load_warnings => [ ( qr/Warning/) x 3 ],
apply_fix => 1,
},
);
my $cache_file = 't/model_tests.d/debian-dependency-cache.txt';
my $ch = new IO::File "$cache_file";
foreach ($ch->getlines) {
chomp;
my ($k,$v) = split m/ => / ;
$Config::Model::Debian::Dependency::cache{$k} = time . ' '. $v ;
}
$ch -> close ;
END {
return if $::DebianDependencyCacheWritten ;
my %h = %Config::Model::Debian::Dependency::cache ;
map { s/^\d+ //;} values %h ; # remove time stamp
my $str = join ("\n", map { "$_ => $h{$_}" ;} sort keys %h) ;
my $fh = new IO::File "> $cache_file";
print "writing back cache file\n";
if ( defined $fh ) {
# not a big deal if cache cannot be written back
$fh->print($str);
$fh->close;
$::DebianDependencyCacheWritten=1;
}
}
1;
|