Tests in libconfig-model-dpkg-perl
Hi Dominique, Perl team,
I have just pushed commit 13b6b51 that extends autopkgtest support in
libconfig-model-dpkg-perl. It adds full support for pkg-go, and makes it
recognise also dkms, elpa, nodejs, python, and r as valid testsuites.
While doing this, I added some tests, and actually verified they failed
before modifing the code. Surprisingly, I found that some of them did not!
foreach my $target (qw(dkms elpa go nodejs perl python r ruby)) {
warning_is {
$root->load("control source Testsuite=autopkgtest-pkg-$target");
} undef, "check that Testsuite is accepted for autopkgtest-pkg-$target";
}
I noticed that this was dependent on ordering, and since I really don't
understand much what's going on on these tests, I tried to find a way to
make the state consistent. I've found that applying fixes *and* grabbing
the value did this (but not if only one of the two ops happened). So the
code is now:
foreach my $target (qw(dkms elpa go nodejs perl python r ruby)) {
warning_is {
$root->load("control source Testsuite=autopkgtest-pkg-$target");
} undef, "check that Testsuite is accepted for autopkgtest-pkg-$target";
$root->grab('control source Testsuite')->apply_fixes;
is($root->grab_value("control source Testsuite"),
"autopkgtest-pkg-$target", 'check Testsuite value');
}
So, I would appreciate it if somebody who knows better takes a look at
this :-)
Thanks, Tincho.
--
Martín Ferrari (Tincho)
Reply to: