Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/engine/jam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,7 @@ int guarded_main(int argc, char * argv[])
{
err_printf("Invalid value for the '-j' option.\n");
b2::clean_exit(EXITBAD);
return false;
}
globs.jobs = val;
return true;
});

Expand Down
4 changes: 3 additions & 1 deletion test/BoostBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,9 @@ def run_build_system(self, extra_args=None, subdir="", stdout=None,
kw["program"] += self.program
if extra_args:
kw["program"] += extra_args
if not extra_args or not any(a.startswith("-j") for a in extra_args):
if ((not extra_args
or not any(a.startswith("-j") for a in extra_args))
and not any(a.startswith("-j") for a in self.program[1:])):
kw["program"] += ["-j1"]
if stdout is None and not any(a.startswith("-d") for a in kw["program"]):
kw["program"] += self.verbosity
Expand Down
20 changes: 10 additions & 10 deletions test/semaphore.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ def update(mode, sentry, secs, target):
# parallel action ran, ignoring the semaphore.
if secs > 0:
raise RuntimeError
# Indicate we completed, and create our result target.
unlink(sentry + target)
# Create our result target and indicate we completed.
touch(target)
unlink(sentry + target)


if len(sys.argv) == 5:
# called by jam update action
# python semaphore.py <sentry_fname> <sleep_secs> <target_fname>
# python semaphore.py <mode> <sentry_prefix> <sleep_secs> <target_fname>
update(*sys.argv[1:])
sys.exit()

Expand All @@ -60,25 +60,25 @@ def update(mode, sentry, secs, target):

import BoostBuild

t = BoostBuild.Tester(["-ffile.jam"], pass_toolset=False)
t = BoostBuild.Tester(["-ffile.jam", "-j2"], pass_toolset=False)

# 1. test parallel execution of update
t.write(
"file.jam",
"""\
actions update
{{
"{0}" "{1}" parallel sentry 1 $(<)
"{}" "{}" parallel sentry 1 $(<)
}}
update x1 ;
update x2 ;
DEPENDS all : x1 x2 ;
""".format(
sys.executable, script
),
)
)

t.run_build_system(extra_args=["-j2"])
t.run_build_system()
t.expect_addition("x1")
t.expect_addition("x2")
t.expect_output_lines("PARALLEL UPDATE")
Expand All @@ -92,15 +92,15 @@ def update(mode, sentry, secs, target):
"""\
actions update
{{
"{0}" "{1}" semaphore sentry 1 $(<)
"{}" "{}" semaphore sentry 1 $(<)
}}
JAM_SEMAPHORE on x1 x2 = <s>update_sem ;
update x1 ;
update x2 ;
DEPENDS all : x1 x2 ;
""".format(
sys.executable, script
),
)
)

expected_output = """\
Expand All @@ -112,7 +112,7 @@ def update(mode, sentry, secs, target):
...updated 2 targets...
"""

t.run_build_system(stdout=expected_output, extra_args=["-j2"])
t.run_build_system(stdout=expected_output)
t.expect_addition("x1")
t.expect_addition("x2")

Expand Down
Loading