You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

doctest_util.h 929B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // doctest_util.h - an accompanying extensions header to the main doctest.h header
  3. //
  4. // Copyright (c) 2016-2021 Viktor Kirilov
  5. //
  6. // Distributed under the MIT Software License
  7. // See accompanying file LICENSE.txt or copy at
  8. // https://opensource.org/licenses/MIT
  9. //
  10. // The documentation can be found at the library's page:
  11. // https://github.com/onqtam/doctest/blob/master/doc/markdown/readme.md
  12. //
  13. #pragma once
  14. #ifndef DOCTEST_LIBRARY_INCLUDED
  15. #include "../doctest.h"
  16. #endif
  17. #include <memory>
  18. #include <vector>
  19. #include <string>
  20. namespace doctest {
  21. inline void applyCommandLine(doctest::Context& ctx, const std::vector<std::string>& args) {
  22. auto doctest_args = std::make_unique<const char*[]>(args.size());
  23. for (size_t i = 0; i < args.size(); ++i) {
  24. doctest_args[i] = args[i].c_str();
  25. }
  26. ctx.applyCommandLine(args.size(), doctest_args.get());
  27. }
  28. } // namespace doctest