Commit 27aa4d58 authored by Patrick Chen's avatar Patrick Chen

support delay test

parent 5d7ea9c4
#include <chrono>
#include <cstdlib> #include <cstdlib>
#include <iostream> #include <iostream>
#include <string>
#include <thread>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
...@@ -10,10 +13,12 @@ ...@@ -10,10 +13,12 @@
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
if (argc < 2) { if (argc < 2) {
std::cerr << "usage: " << argv[0] << " config" << std::endl; std::cerr << "usage: " << argv[0] << " config [delay]" << std::endl;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
const unsigned testDelay = (3 <= argc ? std::stoul(argv[2]) : 0u);
namespace fs = boost::filesystem; namespace fs = boost::filesystem;
const auto configFile = fs::absolute(argv[1]); const auto configFile = fs::absolute(argv[1]);
if (!fs::is_regular_file(configFile)) { if (!fs::is_regular_file(configFile)) {
...@@ -22,5 +27,10 @@ int main(int argc, char* argv[]) { ...@@ -22,5 +27,10 @@ int main(int argc, char* argv[]) {
} }
xs::test::Tester tester{configFile}; xs::test::Tester tester{configFile};
std::this_thread::sleep_for(
std::chrono::seconds(testDelay)
);
tester.run(); tester.run();
} }
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