]> git.donarmstrong.com Git - debhelper.git/blobdiff - t/buildsystems/buildsystem_tests
cmake: Pass CPPFLAGS in CFLAGS. Closes: #668813 Thanks, Simon Ruderich for the patch...
[debhelper.git] / t / buildsystems / buildsystem_tests
index 1a9e21ca3508b4b81bf160c64dce310d8b1b936d..98b3895ea6fefa25fb10f417d5201278c0313ad7 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-use Test::More tests => 291;
+use Test::More tests => 297;
 
 use strict;
 use warnings;
@@ -256,7 +256,7 @@ touch "$tmpdir/configure", 0755;
 test_check_auto_buildable($bs{autoconf}, "configure", { configure => 1 });
 
 touch "$tmpdir/CMakeLists.txt";
-test_check_auto_buildable($bs{cmake}, "CMakeLists.txt", { configure => 1 });
+test_check_auto_buildable($bs{cmake}, "CMakeLists.txt", { configure => 1, clean => 1 });
 
 touch "$tmpdir/Makefile.PL";
 test_check_auto_buildable($bs{perl_makemaker}, "Makefile.PL", { configure => 1 });
@@ -499,45 +499,37 @@ ok ( ! -e 'bld', "bld got deleted too" );
 #### Test parallel building and related options / routines
 @tmp = ( $ENV{MAKEFLAGS}, $ENV{DEB_BUILD_OPTIONS} );
 
-# Test is_make_jobserver_unavailable and clean_jobserver_makeflags.
+# Test clean_jobserver_makeflags.
 
 $ENV{MAKEFLAGS} = "--jobserver-fds=103,104 -j";
-ok(is_make_jobserver_unavailable(), "unavailable jobserver" );
 clean_jobserver_makeflags();
 ok(! exists $ENV{MAKEFLAGS}, "unset makeflags");
 
 $ENV{MAKEFLAGS} = "-a --jobserver-fds=103,104 -j -b";
-ok(is_make_jobserver_unavailable(), "unavailable jobserver" );
 clean_jobserver_makeflags();
 is($ENV{MAKEFLAGS}, "-a -b", "clean makeflags");
 
 $ENV{MAKEFLAGS} = " --jobserver-fds=1,2 -j  ";
-ok(! is_make_jobserver_unavailable(), "available jobserver" );
 clean_jobserver_makeflags();
 ok(! exists $ENV{MAKEFLAGS}, "unset makeflags");
 
 $ENV{MAKEFLAGS} = "-a -j -b";
-ok(! is_make_jobserver_unavailable(), "no specified jobserver");
 clean_jobserver_makeflags();
 is($ENV{MAKEFLAGS}, "-a -j -b", "clean makeflags does not remove -j");
 
 $ENV{MAKEFLAGS} = "-a --jobs -b";
-ok(! is_make_jobserver_unavailable(), "no specified jobserver");
 clean_jobserver_makeflags();
 is($ENV{MAKEFLAGS}, "-a --jobs -b", "clean makeflags does not remove --jobs");
 
 $ENV{MAKEFLAGS} = "-j6";
-ok(! is_make_jobserver_unavailable(), "no specified jobserver");
 clean_jobserver_makeflags();
 is($ENV{MAKEFLAGS}, "-j6", "clean makeflags does not remove -j6");
 
 $ENV{MAKEFLAGS} = "-a -j6 --jobs=7";
-ok(! is_make_jobserver_unavailable(), "no specified jobserver");
 clean_jobserver_makeflags();
 is($ENV{MAKEFLAGS}, "-a -j6 --jobs=7", "clean makeflags does not remove -j or --jobs");
 
-$ENV{MAKEFLAGS} = "-j6 --jobserver-fds=5,6 --jobs=8";
-ok(is_make_jobserver_unavailable(), "unavailable jobserver");
+$ENV{MAKEFLAGS} = "-j6 --jobserver-fds=103,104 --jobs=8";
 clean_jobserver_makeflags();
 is($ENV{MAKEFLAGS}, "-j6 --jobs=8", "jobserver options removed");
 
@@ -572,21 +564,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";
@@ -616,7 +614,7 @@ override_dh_auto_build:
        $(MAKE)
 %:
        @dh_clean > /dev/null 2>&1
-       @+dh --buildsystem=makefile --after=dh_auto_configure --until=dh_auto_build $@
+       @+dh --buildsystem=makefile --after=dh_auto_configure --until=dh_auto_build $@ 2>/dev/null
        @dh_clean > /dev/null 2>&1
 EOF
 test_is_parallel( do_rules_for_parallel("build", "include debian/rules"),