enum_name
Loading...
Searching...
No Matches
doctest_util.h
1//
2// doctest_util.h - an accompanying extensions header to the main doctest.h header
3//
4// Copyright (c) 2016-2023 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/doctest/doctest/blob/master/doc/markdown/readme.md
12//
13
14#ifndef DOCTEST_UTIL_H
15#define DOCTEST_UTIL_H
16
17#ifndef DOCTEST_LIBRARY_INCLUDED
18#include "../doctest.h"
19#endif
20
21#include <memory>
22#include <vector>
23#include <string>
24
25namespace doctest {
26
27 inline void applyCommandLine(doctest::Context& ctx, const std::vector<std::string>& args) {
28 auto doctest_args = std::make_unique<const char*[]>(args.size());
29 for (size_t i = 0; i < args.size(); ++i) {
30 doctest_args[i] = args[i].c_str();
31 }
32 ctx.applyCommandLine(args.size(), doctest_args.get());
33 }
34
35} // namespace doctest
36
37#endif // DOCTEST_UTIL_H
Definition doctest.h:1965