Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
On 2013-02-08 18:13, Nicolas Boulenguez wrote:
>I wrote at some point:
>> Thanks for the code. I have attached a small diff for some
>> stylistic things (note the test .desc changes also prevents a
>> "synopsis not phrased properly tag").
For the record, the "my-changes.diff" was intended to be an interdiff
between your changes and the 4-5 lines changes I did (instead of yours
plus mine). I have attached "my-real-changes.diff" in case you are
interested.
>> Please see test.log.
>
> Sorry, I did not detect these problems because I test with 2.5.11 and
> --root option.
>
It might be help to use Lintian test runner itself to run the test.
Example:
debian/rules runtests onlyrun=testsuite-control-syntax
Only runs tests named "testsuite-control-syntax" (I believe we only have
one atm.) You can also use
debian/rules runtests onlyrun=testsuite
to run all tests "related" to the check "testsuite"[1].
> Three pedantic messages were not reported, I copied similar options
> from another test to "t/tests/testsuite-general/desc" to unmask them.
>
> Path "debian/tests/fifo" is reported missing instead of non regular. I
> guess that it will be created once
> "t/tests/testsuite-general/pre_build" is marked executable.
>
Thanks.
> But I fail to understand the third problem.
> File "t/tests/testsuite-general/debian/debian/tests/control"
> contains the line "Tests: fifo missing-test under_score"
> and script "checks/testsuite"
> reads it with "for (split ' ', $paragraph->{'tests'})"
> so "under_score" should be checked after "fifo" and "missing-test".
> The execution order is correct on my machine, but no in your test.log.
> Any clue?
The test runner sorts the output by default as it makes the tests more
robust (otherwise even simple reordering or refactoring would make a
mess of the testsuite). So, the last issue is that the tags file must
be sorted as well. I took the liberty of fixing that. :)
Committed and pushed your addition as 386b337.
Thank you for your contribution, :)
~Niels
[1] "Related" being starting with "testsuite-".
diff -u b/checks/testsuite b/checks/testsuite
--- b/checks/testsuite
+++ b/checks/testsuite
@@ -22,19 +22,12 @@
use strict;
use warnings;
-use Lintian::Tags qw(
- tag
-);
+use Lintian::Tags qw(tag);
use Lintian::Util qw(
file_is_encoded_in_non_utf8
read_dpkg_control
);
-sub run;
-sub check_control_contents;
-sub check_control_paragraph;
-sub check_test_file;
-
my @mandatory_fields = qw(
tests
);
@@ -77,7 +70,7 @@
tag 'debian-tests-control-uses-national-encoding', "at line $not_utf8_line";
}
- check_control_contents $info, $path;
+ check_control_contents ($info, $path);
}
}
}
@@ -91,7 +84,7 @@
tag 'syntax-error-in-debian-tests-control', $@;
} else {
for (@paragraphs) {
- check_control_paragraph $info, $_;
+ check_control_paragraph ($info, $_);
}
}
}
@@ -130,7 +123,7 @@
$directory = 'debian/tests';
}
for (split ' ', $paragraph->{'tests'}) {
- check_test_file $info, $directory, $_;
+ check_test_file ($info, $directory, $_);
}
}
}
diff -u b/t/tests/testsuite-control-syntax/desc b/t/tests/testsuite-control-syntax/desc
--- b/t/tests/testsuite-control-syntax/desc
+++ b/t/tests/testsuite-control-syntax/desc
@@ -3,3 +3,3 @@
Version: 1.0
-Description: Detection of syntax errors in autopkgtest control file.
+Description: Detection of syntax errors in autopkgtest control file
Test-For: syntax-error-in-debian-tests-control
Reply to: