summaryrefslogtreecommitdiffstats
path: root/t/scripts/03-strict/runner.pl
diff options
context:
space:
mode:
Diffstat (limited to 't/scripts/03-strict/runner.pl')
-rwxr-xr-xt/scripts/03-strict/runner.pl47
1 files changed, 47 insertions, 0 deletions
diff --git a/t/scripts/03-strict/runner.pl b/t/scripts/03-strict/runner.pl
new file mode 100755
index 0000000..79f4933
--- /dev/null
+++ b/t/scripts/03-strict/runner.pl
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Const::Fast;
+use Test::More;
+
+use Test::Lintian;
+
+const my $DOT => q{.};
+
+if ($ENV{'LINTIAN_COVERAGE'}) {
+ plan 'skip_all' => 'Not needed for coverage of Lintian';
+}
+
+eval 'use Test::Strict';
+plan skip_all => 'Test::Strict required to run this test' if $@;
+
+{
+ no warnings 'once';
+ $Test::Strict::TEST_WARNINGS = 1;
+}
+
+$ENV{'LINTIAN_BASE'} //= $DOT;
+# Files in commands check for the presence of LINTIAN_INCLUDE_DIRS in
+# BEGIN, so make sure it is present for them.
+$ENV{'LINTIAN_INCLUDE_DIRS'} = $ENV{'LINTIAN_BASE'};
+
+if ($0 =~ m{^(?:.*/)?reporting\.t$}) {
+ # html_reports loads ./config, so we have do chdir before checking it.
+ my $folder = "$ENV{LINTIAN_BASE}/reporting";
+ chdir($folder)
+ or die "Cannot change directory $folder";
+
+ all_perl_files_ok($DOT);
+
+} else {
+ my @test_paths = program_name_to_perl_paths($0);
+ all_perl_files_ok(@test_paths);
+}
+
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End:
+# vim: syntax=perl sw=4 sts=4 sr et