#!/usr/bin/perl

use strict;
use warnings;

use Debian::Debhelper::Dh_Lib;

=head1 NAME

dh_perl6_test -- automatically test perl 6 module packages

=head1 SYNOPSIS

B<dh_perl6_test>

=head1 DESCRIPTION

This script will call 'prove6 -l' to self-test a perl 6 module package. It will 
only do so if three conditions are met:

=over

=item *

A 't' directory exists

=item * 

perl6-tap-harness is installed, typically by adding it to the build-depencies
of the package being built

=item *

The debhelper build option 'nocheck' is not set

=back

=head1 SEE ALSO

L<dh_perl6_maintscript>(1), L<dh_perl6_depsfile>(1), L<debhelper>(7), L<dh>(1)

=cut

if (get_buildoption("nocheck")) {
	exit 0;
}

if ((-d 't') && (-e '/usr/bin/prove6')) {
    print_and_doit(qw{/usr/bin/prove6 -l});
}
