Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CTest/cmCTestLaunch.h
5000 views
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 <string>
8
#include <vector>
9
10
#include "cmCTestLaunchReporter.h"
11
12
namespace cmsys {
13
class RegularExpression;
14
}
15
16
/** \class cmCTestLaunch
17
* \brief Launcher for make rules to report results for ctest
18
*
19
* This implements the 'ctest --launch' tool.
20
*/
21
class cmCTestLaunch
22
{
23
24
public:
25
enum class Op
26
{
27
Normal,
28
Instrument,
29
};
30
31
/** Entry point from ctest executable main(). */
32
static int Main(int argc, char const* const argv[], Op operation);
33
34
cmCTestLaunch(cmCTestLaunch const&) = delete;
35
cmCTestLaunch& operator=(cmCTestLaunch const&) = delete;
36
37
private:
38
// Initialize the launcher from its command line.
39
cmCTestLaunch(int argc, char const* const* argv, Op operation);
40
~cmCTestLaunch();
41
42
// Run the real command.
43
int Run();
44
void RunChild();
45
46
// Method to check the result of the real command.
47
bool CheckResults();
48
49
// Parse out launcher-specific options specified before the real command.
50
bool ParseArguments(int argc, char const* const* argv);
51
52
// The real command line appearing after launcher arguments.
53
std::vector<std::string> RealArgV;
54
55
// The real command line after response file expansion.
56
std::vector<std::string> RealArgs;
57
void HandleRealArg(char const* arg);
58
59
// Whether or not any data have been written to stdout or stderr.
60
bool HaveOut;
61
bool HaveErr;
62
63
// Load custom rules to match warnings and their exceptions.
64
bool ScrapeRulesLoaded;
65
void LoadScrapeRules();
66
void LoadScrapeRules(char const* purpose,
67
std::vector<cmsys::RegularExpression>& regexps) const;
68
bool ScrapeLog(std::string const& fname);
69
70
// Helper class to generate the xml fragment.
71
cmCTestLaunchReporter Reporter;
72
73
// Configuration
74
void LoadConfig();
75
76
// Mode
77
Op Operation;
78
};
79
80