diff --git a/lib/syskit/network_generation/merge_solver.rb b/lib/syskit/network_generation/merge_solver.rb index 5040f4034..bc14a26e3 100644 --- a/lib/syskit/network_generation/merge_solver.rb +++ b/lib/syskit/network_generation/merge_solver.rb @@ -138,6 +138,7 @@ def apply_merge_group(merged_task_to_task) merged_task_to_task.each do |merged_task, task| unless merged_task.transaction_proxy? + plan.copy_task_marks(from: merged_task, to: task) plan.remove_task(merged_task) end register_replacement(merged_task, task) diff --git a/test/network_generation/test_merge_solver.rb b/test/network_generation/test_merge_solver.rb index f0414eb29..50b2348e1 100644 --- a/test/network_generation/test_merge_solver.rb +++ b/test/network_generation/test_merge_solver.rb @@ -358,6 +358,32 @@ def mock_merged_task_with_concrete_input_connections(*connections) end end + describe "#apply_merge_group" do + attr_reader :local_plan, :solver + + before do + @local_plan = Roby::Plan.new + @solver = Syskit::NetworkGeneration::MergeSolver.new(@local_plan) + end + + # I don't like the "destination task" name but couldn't thought in a better one + it "applyes merged task plan marks to the destination task" do + task1 = Roby::Task.new + task2 = Roby::Task.new + + local_plan.add_permanent_task task1 + local_plan.add_mission_task task1 + + refute local_plan.permanent_task? task2 + refute local_plan.mission_task? task2 + + solver.apply_merge_group({ task1 => task2 }) + + assert local_plan.permanent_task? task2 + assert local_plan.mission_task? task2 + end + end + describe "functional tests" do describe "merging compositions" do attr_reader :plan, :srv_m, :task_m, :cmp_m