]> git.donarmstrong.com Git - debhelper.git/blob - dh_auto_test
Merge branch 'master' into buildsystems
[debhelper.git] / dh_auto_test
1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 dh_auto_test - automatically runs a package's test suites
6
7 =cut
8
9 use strict;
10 use Debian::Debhelper::Dh_Buildsystems;
11
12 =head1 SYNOPSIS
13
14 B<dh_auto_test> [S<I<debhelper options>>] [S<B<--> I<params>>]
15
16 =head1 DESCRIPTION
17
18 dh_auto_test is a debhelper program that tries to automatically run a
19 package's test suite. If there's a Makefile and it contains a "test"
20 or "check" target, then this is  done by running make (or MAKE, if the
21 environment variable is set). If the test suite fails, the command will
22 exit nonzero. If there's no test suite, it will exit zero without doing
23 anything.
24
25 This is intended to work for about 90% of packages with a test suite. If it
26 doesn't work, you're encouraged to skip using dh_auto_test at all, and
27 just run the test suite manually.
28
29 =head1 OPTIONS
30
31 =over 4
32
33 =item B<--> I<params>
34
35 Pass "params" to the program that is run. These can be used to supplement
36 or override the any standard parameters that dh_auto_test passes.
37
38 =back
39
40 =head1 NOTES
41
42 If the DEB_BUILD_OPTIONS environment variable contains "nocheck", no
43 tests will be performed.
44
45 =cut
46
47 if (defined $ENV{DEB_BUILD_OPTIONS} && $ENV{DEB_BUILD_OPTIONS} =~ /nocheck/) {
48         exit 0;
49 }
50
51 buildsystems_init();
52 buildsystems_do();
53
54 =head1 SEE ALSO
55
56 L<debhelper(7)>
57
58 This program is a part of debhelper.
59
60 =head1 AUTHOR
61
62 Joey Hess <joeyh@debian.org>
63
64 =cut