]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_auto_test
Fix typo in French translation, about debian/package.README.Debian files.
[debhelper.git] / dh_auto_test
index 74a80e8c166f24419cfe7e8888a7c4f09ddccc6d..900059291d17b924878d8934466b835e8d4c94e2 100755 (executable)
@@ -23,7 +23,7 @@ exit nonzero. If there's no test suite, it will exit zero without doing
 anything.
 
 This is intended to work for about 90% of packages with a test suite. If it
-doesn't work, you're encoruaged to skip using dh_auto_test at all, and
+doesn't work, you're encouraged to skip using dh_auto_test at all, and
 just run the test suite manually.
 
 =head1 OPTIONS
@@ -42,15 +42,21 @@ or override the any standard parameters that dh_auto_test passes.
 init();
 
 if (-e "Makefile" || -e "makefile" || -e "GNUmakefile") {
+       $ENV{MAKE}="make" unless exists $ENV{MAKE};
        foreach my $target (qw{test check}) {
-               my $ret=system("make --question $target >/dev/null 2>&1");
-               if ($ret == 0) {
-                       doit(exists $ENV{MAKE} ? $ENV{MAKE} : "make",
-                               $target, @{$dh{U_PARAMS}});
+               # Use make -n to check to see if the target would do
+               # anything. There's no good way to test if a target exists.
+               my $ret=`$ENV{MAKE} -s -n $target 2>/dev/null`;
+               chomp $ret;
+               if (length $ret) {
+                       doit($ENV{MAKE}, $target, @{$dh{U_PARAMS}});
                        last;
                }
        }
 }
+elsif (-e "Build.PL" && -e "Build") {
+       doit(qw/perl Build test/, @{$dh{U_PARAMS}});
+}
 
 =head1 SEE ALSO