#!/usr/bin/perl
-use Test::More tests => 312;
+use Test::More tests => 291;
use strict;
use warnings;
test_check_auto_buildable($bs{autoconf}, "configure", { configure => 1 });
touch "$tmpdir/CMakeLists.txt";
-test_check_auto_buildable($bs{cmake}, "CMakeLists.txt", 1);
+test_check_auto_buildable($bs{cmake}, "CMakeLists.txt", { configure => 1 });
touch "$tmpdir/Makefile.PL";
test_check_auto_buildable($bs{perl_makemaker}, "Makefile.PL", { configure => 1 });
"No parallel by default" );
$ENV{DEB_BUILD_OPTIONS}="parallel=5";
-test_is_parallel( do_parallel_mk(),
+test_isnt_parallel( do_parallel_mk(),
"DEB_BUILD_OPTIONS=parallel=5 without --max-parallel" );
test_is_parallel( do_parallel_mk("--max-parallel=2"),
"DEB_BUILD_OPTIONS=parallel=5 with --max-parallel=2" );
$ENV{MAKEFLAGS} = "--jobserver-fds=105,106 -j";
$ENV{DEB_BUILD_OPTIONS}="";
-test_isnt_parallel( do_parallel_mk(),
+test_isnt_parallel( do_parallel_mk("--max-parallel=5"),
"makefile.pm (no parallel): no make warnings about unavailable jobserver" );
$ENV{DEB_BUILD_OPTIONS}="parallel=5";
-test_is_parallel( do_parallel_mk(),
+test_is_parallel( do_parallel_mk("--max-paralle=5"),
"DEB_BUILD_OPTIONS=parallel=5: no make warnings about unavail parent jobserver" );
$ENV{MAKEFLAGS} = "-j2";
"make -f - $cmdline 2>&1 >/dev/null", $stdin);
}
-# Simulate dpkg-buildpackage -j5
-doit("ln", "-s", "parallel.mk", "Makefile");
-
-sub test_dh_parallel {
- my $extra_dsc=shift || "";
- my $debian_rules=shift || "";
- my $rules;
- my $tmpfile;
-
- $ENV{MAKEFLAGS} = "-j5";
- $ENV{DEB_BUILD_OPTIONS} = "parallel=5";
-
- # Write debian/rules if requested
- $tmpfile = write_debian_rules($debian_rules);
-
- $rules = <<'EOF';
-%:
- @dh_clean > /dev/null 2>&1
- @dh --buildsystem=makefile --after=dh_auto_configure --until=dh_auto_build $@
- @dh_clean > /dev/null 2>&1
-EOF
-
- $ENV{MAKEFLAGS} = "";
- test_is_parallel( do_rules_for_parallel("build", $rules),
- "DEB_BUILD_OPTIONS=parallel=5 without MAKEFLAGS=-jX via dh $extra_dsc" );
-
- $ENV{MAKEFLAGS} = "-j5";
- $rules = <<'EOF';
-%:
- @dh_clean > /dev/null 2>&1
- @dh --max-parallel=1 --buildsystem=makefile --after=dh_auto_configure --until=dh_auto_build $@
- @dh_clean > /dev/null 2>&1
-EOF
- test_isnt_parallel( do_rules_for_parallel("build", $rules),
- "dh --max-parallel=1 disables implicit parallel under dpkg-buildpackage -j5 $extra_dsc");
-
- $rules = <<'EOF';
-%:
- @dh_clean > /dev/null 2>&1
- @dh -j --buildsystem=makefile --after=dh_auto_configure --until=dh_auto_build $@
- @dh_clean > /dev/null 2>&1
-EOF
- test_is_parallel( do_rules_for_parallel("build", $rules),
- "dh -j under dpkg-buildpackage -j5 is parallel $extra_dsc");
- $ENV{MAKEFLAGS} = "";
- test_is_parallel( do_rules_for_parallel("build", $rules),
- "dh -j is parallel only with DEB_BUILD_OPTIONS=parallel=5 $extra_dsc");
-
- if (defined $tmpfile) {
- rename($tmpfile, "debian/rules");
- }
- elsif ($debian_rules) {
- unlink("debian/rules");
- }
-}
-
-# dh should pass the same tests with and without overrides
-test_dh_parallel();
-test_dh_parallel("(with overrides)", <<'EOF');
-#!/usr/bin/make -f
-override_dh_auto_build:
- @dh_auto_build -- -f parallel.mk
-EOF
+doit("ln", "-sf", "parallel.mk", "Makefile");
-# Test if legacy punctuation hacks (+) work as before
+# Test if dh+override+$(MAKE) legacy punctuation hack work as before
$ENV{MAKEFLAGS} = "-j5";
$ENV{DEB_BUILD_OPTIONS} = "parallel=5";
-$tmp = write_debian_rules(<<'EOF');
-#!/usr/bin/make -f
-%:
- @dh_clean > /dev/null 2>&1
- @+dh --buildsystem=makefile --after=dh_auto_configure --until=dh_auto_build $@
- @dh_clean > /dev/null 2>&1
-EOF
-test_is_parallel( do_rules_for_parallel("build", "include debian/rules"),
- "legacy punctuation hacks: +dh, no override" );
-unlink "debian/rules";
-write_debian_rules(<<'EOF');
-#!/usr/bin/make -f
-override_dh_auto_build:
- dh_auto_build
-%:
- @dh_clean > /dev/null 2>&1
- @+dh --buildsystem=makefile --after=dh_auto_configure --until=dh_auto_build $@
- @dh_clean > /dev/null 2>&1
-EOF
-test_is_parallel( do_rules_for_parallel("build", "include debian/rules"),
- "legacy punctuation hacks: +dh, override without +, parallel, no make warnings" );
-unlink "debian/rules";
-
-write_debian_rules(<<'EOF');
-#!/usr/bin/make -f
-override_dh_auto_build:
- +dh_auto_build
-%:
- @dh_clean > /dev/null 2>&1
- @+dh --buildsystem=makefile --after=dh_auto_configure --until=dh_auto_build $@
- @dh_clean > /dev/null 2>&1
-EOF
-test_is_parallel( do_rules_for_parallel("build", "include debian/rules"),
- "legacy punctuation hacks: +dh, override with +" );
-unlink "debian/rules";
-
-write_debian_rules(<<'EOF');
+$tmp = write_debian_rules(<<'EOF');
#!/usr/bin/make -f
override_dh_auto_build:
$(MAKE)