diff options
author | Paul Smith <psmith@gnu.org> | 2016-05-31 02:56:51 -0400 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2016-05-31 03:17:26 -0400 |
commit | 4762480ae9cb8df4878286411f178d32db14eff0 (patch) | |
tree | 97a04dc5edf9f5cd73198e8d38cbcf84c15c01cc /tests/scripts | |
parent | ef6c059e1e4ff119aef48f3ce164bef4cbf467e6 (diff) |
[SV 47995] Ensure forced double-colon rules work with -j.
The fix for SV 44742 had a side-effect that some double-colon targets
were skipped. This happens because the "considered" facility assumed
that all targets would be visited on each walk through the dependency
graph: we used a bit for considered and toggled it on each pass; if
we didn't walk the entire graph on every pass the bit would get out
of sync. The new behavior after SV 44742 might return early without
walking the entire graph. To fix this I changed the considered value
to an integer which is monotonically increasing: it is then never
possible to incorrectly determine that a previous pass through the
graph already considered the current target.
* filedef.h (struct file): make CONSIDERED an unsigned int.
* main.c (main): No longer need to reset CONSIDERED.
* remake.c (update_goal_chain): increment CONSIDERED rather than
inverting it between 0<->1.
(update_file_1): Reset CONSIDERED to 0 so it's re-considered.
(check_dep): Ditto.
* tests/scripts/features/double_colon: Add a regression test.
Diffstat (limited to 'tests/scripts')
-rw-r--r-- | tests/scripts/features/double_colon | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon index 80ddb319..58f126f6 100644 --- a/tests/scripts/features/double_colon +++ b/tests/scripts/features/double_colon @@ -197,6 +197,21 @@ all:: 3 ', '-rs -j2 1 2 root', "all_one\nall_two\nroot\n"); +# SV 47995 : Parallel double-colon rules with FORCE + +run_make_test(' +all:: ; @echo one + +all:: joe ; @echo four + +joe: FORCE ; touch joe-is-forced + +FORCE: +', + '-j5', "one\ntouch joe-is-forced\nfour\n"); + +unlink('joe-is-forced'); + # This tells the test driver that the perl test script executed properly. 1; |