diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-10-10 17:22:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-11-06 19:32:09 +0300 |
commit | f41599c8e9435f3dfec60b872c2b4ae31177efdd (patch) | |
tree | 088f8d9bf906e4a2ed734e034699163c9ccc7306 /libbuild2/script/builtin-options.hxx | |
parent | ac76a4fd2afff48a0d5db84592babe5cabef3a2c (diff) |
Add support for test timeouts
Diffstat (limited to 'libbuild2/script/builtin-options.hxx')
-rw-r--r-- | libbuild2/script/builtin-options.hxx | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/libbuild2/script/builtin-options.hxx b/libbuild2/script/builtin-options.hxx index 5a3f153..d0d3c31 100644 --- a/libbuild2/script/builtin-options.hxx +++ b/libbuild2/script/builtin-options.hxx @@ -326,6 +326,64 @@ namespace build2 bool newline_; bool whitespace_; }; + + class timeout_options + { + public: + timeout_options (); + + timeout_options (int& argc, + char** argv, + bool erase = false, + ::build2::script::cli::unknown_mode option = ::build2::script::cli::unknown_mode::fail, + ::build2::script::cli::unknown_mode argument = ::build2::script::cli::unknown_mode::stop); + + timeout_options (int start, + int& argc, + char** argv, + bool erase = false, + ::build2::script::cli::unknown_mode option = ::build2::script::cli::unknown_mode::fail, + ::build2::script::cli::unknown_mode argument = ::build2::script::cli::unknown_mode::stop); + + timeout_options (int& argc, + char** argv, + int& end, + bool erase = false, + ::build2::script::cli::unknown_mode option = ::build2::script::cli::unknown_mode::fail, + ::build2::script::cli::unknown_mode argument = ::build2::script::cli::unknown_mode::stop); + + timeout_options (int start, + int& argc, + char** argv, + int& end, + bool erase = false, + ::build2::script::cli::unknown_mode option = ::build2::script::cli::unknown_mode::fail, + ::build2::script::cli::unknown_mode argument = ::build2::script::cli::unknown_mode::stop); + + timeout_options (::build2::script::cli::scanner&, + ::build2::script::cli::unknown_mode option = ::build2::script::cli::unknown_mode::fail, + ::build2::script::cli::unknown_mode argument = ::build2::script::cli::unknown_mode::stop); + + // Option accessors. + // + const bool& + success () const; + + // Implementation details. + // + protected: + bool + _parse (const char*, ::build2::script::cli::scanner&); + + private: + bool + _parse (::build2::script::cli::scanner&, + ::build2::script::cli::unknown_mode option, + ::build2::script::cli::unknown_mode argument); + + public: + bool success_; + }; } } |