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 ...@@ -34,7 +34,7 @@ namespace xs { namespace test
explicit Tester(const boost::filesystem::path& file); explicit Tester(const boost::filesystem::path& file);
void run() noexcept; bool run() noexcept;
private: private:
std::string onCommand(const std::string& name, const std::string& params) noexcept; 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 ...@@ -134,7 +134,7 @@ void Tester::onEvent(const std::string& name, const std::string& params) noexcep
receivedEventCount_[name]++; receivedEventCount_[name]++;
} }
void Tester::run() noexcept bool Tester::run() noexcept
{ {
for (const auto& expectation : config_.getExpectations()) { for (const auto& expectation : config_.getExpectations()) {
resetCounters(); resetCounters();
...@@ -166,7 +166,11 @@ void Tester::run() noexcept ...@@ -166,7 +166,11 @@ void Tester::run() noexcept
% boost::algorithm::join(report.missedEvents, ", ") % boost::algorithm::join(report.missedEvents, ", ")
<< std::endl; << std::endl;
} }
return false;
} }
return true;
} }
} } } }
...@@ -32,5 +32,7 @@ int main(int argc, char* argv[]) { ...@@ -32,5 +32,7 @@ int main(int argc, char* argv[]) {
std::chrono::seconds(testDelay) 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