summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-09-13 13:04:45 -0400
committerJoey Hess <joey@kitenet.net>2010-09-13 13:04:45 -0400
commite69683dc13ff9610d982069a9a2e8a311b500655 (patch)
tree4c4387c61c1c64e582963f93108ec9fbe119cf4c /t
parentfdcabe6080fda0c22fc2d862d0b65863d5b6b880 (diff)
Avoid open fd 5 or 6 breaking buildsystem test suite. Closes: #596679
Diffstat (limited to 't')
-rwxr-xr-xt/buildsystems/buildsystem_tests9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/buildsystems/buildsystem_tests b/t/buildsystems/buildsystem_tests
index 15c902a..398fd96 100755
--- a/t/buildsystems/buildsystem_tests
+++ b/t/buildsystems/buildsystem_tests
@@ -499,19 +499,27 @@ ok ( ! -e 'bld', "bld got deleted too" );
#### Test parallel building and related options / routines
@tmp = ( $ENV{MAKEFLAGS}, $ENV{DEB_BUILD_OPTIONS} );
+use POSIX;
+sub closefd {
+ POSIX::close(shift);
+}
+
# Test is_make_jobserver_unavailable and clean_jobserver_makeflags.
$ENV{MAKEFLAGS} = "--jobserver-fds=103,104 -j";
+closefd(103); closefd(104);
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";
+closefd(103); closefd(104);
ok(is_make_jobserver_unavailable(), "unavailable jobserver" );
clean_jobserver_makeflags();
is($ENV{MAKEFLAGS}, "-a -b", "clean makeflags");
$ENV{MAKEFLAGS} = " --jobserver-fds=1,2 -j ";
+# fds left open
ok(! is_make_jobserver_unavailable(), "available jobserver" );
clean_jobserver_makeflags();
ok(! exists $ENV{MAKEFLAGS}, "unset makeflags");
@@ -537,6 +545,7 @@ 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";
+closefd(5); closefd(6);
ok(is_make_jobserver_unavailable(), "unavailable jobserver");
clean_jobserver_makeflags();
is($ENV{MAKEFLAGS}, "-j6 --jobs=8", "jobserver options removed");