Commit 8d530c1b authored by Patrick Chen's avatar Patrick Chen

exit with failure if one of the script fails

parent 1fbd1b19
......@@ -34,7 +34,7 @@ namespace xs { namespace test
explicit Tester(const boost::filesystem::path& file);
void run() noexcept;
bool run() noexcept;
private:
std::string onCommand(const std::string& name, const std::string& params) noexcept;
......
......@@ -134,7 +134,7 @@ void Tester::onEvent(const std::string& name, const std::string& params) noexcep
receivedEventCount_[name]++;
}
void Tester::run() noexcept
bool Tester::run() noexcept
{
for (const auto& expectation : config_.getExpectations()) {
resetCounters();
......@@ -166,7 +166,11 @@ void Tester::run() noexcept
% boost::algorithm::join(report.missedEvents, ", ")
<< std::endl;
}
return false;
}
return true;
}
} }
......@@ -32,5 +32,7 @@ int main(int argc, char* argv[]) {
std::chrono::seconds(testDelay)
);
tester.run();
if (!tester.run()) {
return EXIT_FAILURE;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment