/src/CMake/Source/cmTestDiscovery.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #pragma once |
4 | | |
5 | | #include "cmConfigure.h" // IWYU pragma: keep |
6 | | |
7 | | #include "cmArgumentParser.h" |
8 | | |
9 | | struct cmTestDiscoveryArgs : ArgumentParser::ParseResult |
10 | | { |
11 | | ArgumentParser::NonEmpty<std::vector<std::string>> Command; |
12 | | ArgumentParser::NonEmpty<std::vector<std::string>> DiscoveryArgs; |
13 | | ArgumentParser::NonEmpty<std::string> DiscoveryMatch; |
14 | | ArgumentParser::MaybeEmpty<std::vector<std::string>> DiscoveryProperties; |
15 | | ArgumentParser::NonEmpty<std::string> TestName; |
16 | | ArgumentParser::NonEmpty<std::vector<std::string>> TestArgs; |
17 | | ArgumentParser::MaybeEmpty<std::vector<std::string>> TestProperties; |
18 | | }; |
19 | | |
20 | | template <typename Args> |
21 | | auto cmTestDiscoveryParser() -> cmArgumentParser<Args> |
22 | 0 | { |
23 | 0 | static_assert(std::is_base_of<cmTestDiscoveryArgs, Args>::value, ""); |
24 | 0 | return cmArgumentParser<Args>{} |
25 | 0 | .Bind("COMMAND"_s, &Args::Command) |
26 | 0 | .Bind("DISCOVERY_ARGS"_s, &Args::DiscoveryArgs) |
27 | 0 | .Bind("DISCOVERY_MATCH"_s, &Args::DiscoveryMatch) |
28 | 0 | .Bind("DISCOVERY_PROPERTIES"_s, &Args::DiscoveryProperties) |
29 | 0 | .Bind("TEST_NAME"_s, &Args::TestName) |
30 | 0 | .Bind("TEST_ARGS"_s, &Args::TestArgs) |
31 | 0 | .Bind("TEST_PROPERTIES"_s, &Args::TestProperties); |
32 | 0 | } |