]> git.donarmstrong.com Git - debhelper.git/blobdiff - t/buildsystems/buildsystem_tests
adjust for new buildsystem
[debhelper.git] / t / buildsystems / buildsystem_tests
index 34b18773a150a77c4bbaf510b9ef54a13a2651cd..15c902af7f19dd653cb36e44105979198ac2925d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use Test::More tests => 297;
+use Test::More tests => 300;
 
 use strict;
 use warnings;
@@ -572,21 +572,27 @@ sub test_is_parallel {
 
 test_isnt_parallel( do_parallel_mk(),
        "No parallel by default" );
+test_isnt_parallel( do_parallel_mk("parallel"),
+       "No parallel by default with --parallel" );
+test_isnt_parallel( do_parallel_mk("--max-parallel=5"),
+       "No parallel by default with --max-parallel=5" );
 
 $ENV{DEB_BUILD_OPTIONS}="parallel=5";
 test_isnt_parallel( do_parallel_mk(),
-       "DEB_BUILD_OPTIONS=parallel=5 without --max-parallel" );
+       "DEB_BUILD_OPTIONS=parallel=5 without parallel options" );
+test_is_parallel( do_parallel_mk("--parallel"),
+       "DEB_BUILD_OPTIONS=parallel=5 with --parallel" );
 test_is_parallel( do_parallel_mk("--max-parallel=2"),
        "DEB_BUILD_OPTIONS=parallel=5 with --max-parallel=2" );
 test_isnt_parallel( do_parallel_mk("--max-parallel=1"),
-       "DEB_BUILD_OPTIONS=parallel=5 with --max-parallel=1 (off)" );
+       "DEB_BUILD_OPTIONS=parallel=5 with --max-parallel=1" );
 
 $ENV{MAKEFLAGS} = "--jobserver-fds=105,106 -j";
 $ENV{DEB_BUILD_OPTIONS}="";
-test_isnt_parallel( do_parallel_mk("--max-parallel=5"),
+test_isnt_parallel( do_parallel_mk(),
        "makefile.pm (no parallel): no make warnings about unavailable jobserver" );
 $ENV{DEB_BUILD_OPTIONS}="parallel=5";
-test_is_parallel( do_parallel_mk("--max-paralle=5"),
+test_is_parallel( do_parallel_mk("--parallel"),
        "DEB_BUILD_OPTIONS=parallel=5: no make warnings about unavail parent jobserver" );
 
 $ENV{MAKEFLAGS} = "-j2";
@@ -604,55 +610,19 @@ sub do_rules_for_parallel {
                "make -f - $cmdline 2>&1 >/dev/null", $stdin);
 }
 
-doit("ln", "-s", "parallel.mk", "Makefile");
+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 --max-parallel=5 --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 --max-parallel=5 --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 --max-parallel=5 --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)
 %:
        @dh_clean > /dev/null 2>&1
-       @+dh --buildsystem=makefile --max-parallel=5 --after=dh_auto_configure --until=dh_auto_build $@
+       @+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"),