virtual ~RealCommandRunner() {}
virtual bool CanRunMore();
virtual bool StartCommand(Edge* edge);
- virtual void WaitForCommands(string* err);
+ virtual void WaitForCommands();
virtual Edge* NextFinishedCommand();
SubprocessSet subprocs_;
return true;
}
-void RealCommandRunner::WaitForCommands(string* err) {
+void RealCommandRunner::WaitForCommands() {
while (subprocs_.finished_.empty()) {
- subprocs_.DoWork(err); // XXX handle err
+ subprocs_.DoWork();
}
}
if (Edge* edge = command_runner_->NextFinishedCommand())
FinishEdge(edge);
else
- command_runner_->WaitForCommands(err);
+ command_runner_->WaitForCommands();
}
return true;
virtual ~CommandRunner() {}
virtual bool CanRunMore() = 0;
virtual bool StartCommand(Edge* edge) = 0;
- virtual void WaitForCommands(string* err) = 0;
+ virtual void WaitForCommands() = 0;
virtual Edge* NextFinishedCommand() = 0;
};
// CommandRunner impl
virtual bool CanRunMore();
virtual bool StartCommand(Edge* edge);
- virtual void WaitForCommands(string* err);
+ virtual void WaitForCommands();
virtual Edge* NextFinishedCommand();
// DiskInterface
return false;
}
-void BuildTest::WaitForCommands(string* err) {
+void BuildTest::WaitForCommands() {
}
Edge* BuildTest::NextFinishedCommand() {
running_.push_back(subprocess);
}
-void SubprocessSet::DoWork(string* err) {
+void SubprocessSet::DoWork() {
struct pollfd* fds = new pollfd[running_.size() * 2];
map<int, Subprocess*> fd_to_subprocess;
// is a queue of subprocesses as they finish.
struct SubprocessSet {
void Add(Subprocess* subprocess);
- void DoWork(string* err);
+ void DoWork();
Subprocess* NextFinished();
vector<Subprocess*> running_;
EXPECT_TRUE(ls->Start("ls /"));
subprocs.Add(ls);
- string err;
while (!ls->done()) {
- subprocs.DoWork(&err);
- ASSERT_EQ("", err);
+ subprocs.DoWork();
}
ASSERT_NE("", ls->stdout_.buf_);
ASSERT_EQ("", processes[i]->stderr_.buf_);
}
- string err;
while (!processes[0]->done() || !processes[1]->done() ||
!processes[2]->done()) {
ASSERT_GT(subprocs.running_.size(), 0);
- subprocs.DoWork(&err);
- ASSERT_EQ("", err);
+ subprocs.DoWork();
}
ASSERT_EQ(0, subprocs.running_.size());