]> 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<build system options>>] [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. It does so by running the appropriate command for the
20 build system it detects the package uses. For example, if there's a
21 Makefile and it contains a "test" or "check" target, then this is  done by
22 running make (or MAKE, if the environment variable is set). If the test
23 suite fails, the command will exit nonzero. If there's no test suite, it
24 will exit zero without doing anything.
25
26 This is intended to work for about 90% of packages with a test suite. If it
27 doesn't work, you're encouraged to skip using dh_auto_test at all, and
28 just run the test suite manually.
29
30 =head1 OPTIONS
31
32 See L<debhelper(7)/BUILD SYSTEM OPTIONS> for a list of common build
33 system selection and control options.
34
35 =over 4
36
37 =item B<--> I<params>
38
39 Pass "params" to the program that is run. These can be used to supplement
40 or override the any standard parameters that dh_auto_test passes.
41
42 =back
43
44 =head1 NOTES
45
46 If the DEB_BUILD_OPTIONS environment variable contains "nocheck", no
47 tests will be performed.
48
49 =cut
50
51 if (defined $ENV{DEB_BUILD_OPTIONS} && $ENV{DEB_BUILD_OPTIONS} =~ /nocheck/) {
52         exit 0;
53 }
54
55 buildsystems_init();
56 buildsystems_do();
57
58 =head1 SEE ALSO
59
60 L<debhelper(7)>
61
62 This program is a part of debhelper.
63
64 =head1 AUTHOR
65
66 Joey Hess <joeyh@debian.org>
67
68 =cut