[commands] Define order of parallel groups (#6602)

This commit is contained in:
Joseph Eng
2024-06-01 12:01:15 -07:00
committed by GitHub
parent 7751f6d1d2
commit 1828fdaaa4
6 changed files with 296 additions and 9 deletions

View File

@@ -132,8 +132,8 @@ CommandPtr CommandPtr::BeforeStarting(CommandPtr&& before) && {
CommandPtr CommandPtr::WithTimeout(units::second_t duration) && {
AssertValid();
std::vector<std::unique_ptr<Command>> temp;
temp.emplace_back(std::make_unique<WaitCommand>(duration));
temp.emplace_back(std::move(m_ptr));
temp.emplace_back(std::make_unique<WaitCommand>(duration));
m_ptr = std::make_unique<ParallelRaceGroup>(std::move(temp));
return std::move(*this);
}
@@ -141,8 +141,8 @@ CommandPtr CommandPtr::WithTimeout(units::second_t duration) && {
CommandPtr CommandPtr::Until(std::function<bool()> condition) && {
AssertValid();
std::vector<std::unique_ptr<Command>> temp;
temp.emplace_back(std::make_unique<WaitUntilCommand>(std::move(condition)));
temp.emplace_back(std::move(m_ptr));
temp.emplace_back(std::make_unique<WaitUntilCommand>(std::move(condition)));
m_ptr = std::make_unique<ParallelRaceGroup>(std::move(temp));
return std::move(*this);
}