File Coverage

File:/home/guillem/src/debian/dpkg/build-aux/test-runner
Coverage:79.5%

linestmtbrancondsubpodtimecode
1#!/usr/bin/perl
2
3
3
3
3
5765
3
111
use strict;
4
3
3
3
8
3
149
use warnings;
5
6
3
3
3
932
21024
2537
use TAP::Harness;
7
8
3
87627
my $srcroot = $ENV{abs_top_srcdir};
9
3
4
my $binroot = $ENV{abs_top_builddir};
10
11# Setup the environment
12
3
22
$ENV{LC_ALL} = 'C';
13
3
9
$ENV{DPKG_COLORS} = 'never';
14
3
9
$ENV{PATH} = "$binroot/src:$binroot/scripts:$binroot/utils:$ENV{PATH}";
15
16
3
3
my %options;
17# XXX: We need force the file formatter to workaround verbose + parallel
18# not working correctly, as the console formatter eats the test output,
19# see <https://github.com/Perl-Toolchain-Gang/Test-Harness/issues/105>.
20
3
5
if ($ENV{TEST_VERBOSE} && $ENV{TEST_PARALLEL} > 1) {
21
0
0
    $options{formatter_class} = 'TAP::Formatter::File';
22}
23
24my $harness = TAP::Harness->new({
25    exec => sub {
26
144
1040130027
        my (undef, $test) = @_;
27
144
1172
        return [ $test ] if $test !~ m/\.t$/ and -x $test;
28        return
29
144
239
    },
30    lib => [
31        "$srcroot/scripts",
32        "$srcroot/dselect/methods"
33    ],
34    color => 1,
35    verbosity => $ENV{TEST_VERBOSE},
36    jobs => $ENV{TEST_PARALLEL},
37
3
31
    failures => 1,
38    %options,
39});
40
41
3
35469
my $aggregate = $harness->runtests(@ARGV);
42
3
39135459
die "FAIL: test suite has errors\n" if $aggregate->has_errors;