]> git.donarmstrong.com Git - debhelper.git/commitdiff
add test of dh's makefile parsing
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 17 Jul 2009 19:24:21 +0000 (21:24 +0200)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 17 Jul 2009 19:24:21 +0000 (21:24 +0200)
t/override_target [new file with mode: 0755]

diff --git a/t/override_target b/t/override_target
new file mode 100755 (executable)
index 0000000..995d032
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+use Test;
+plan(tests => 1);
+
+# This test is here to detect breakage in
+# dh's rules_explicit_target, which parses
+# slightly internal make output.
+system("mkdir -p t/tmp/debian");
+system("cp debian/control t/tmp/debian");
+open (OUT, ">", "t/tmp/debian/rules") || die "$!";
+print OUT <<EOF;
+#!/usr/bin/make -f
+%:
+       dh \$@
+override_dh_auto_build:
+       echo "override called"
+EOF
+close OUT;
+system("chmod +x t/tmp/debian/rules");
+my @output=`cd t/tmp && debian/rules build 2>&1`;
+ok(grep { m/override called/ } @output);
+system("rm -rf t/tmp");