cmake/Source/CTest/cmCTestLaunch.h

72 lines
1.9 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2009-10-04 10:30:41 +03:00
2017-07-20 19:35:53 +02:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-07-09 11:21:54 +02:00
2016-10-30 18:24:19 +01:00
#include <string>
#include <vector>
2009-10-04 10:30:41 +03:00
2021-09-14 00:13:48 +02:00
#include "cmCTestLaunchReporter.h"
2020-02-01 23:06:01 +01:00
2021-09-14 00:13:48 +02:00
namespace cmsys {
class RegularExpression;
}
2015-08-17 11:37:30 +02:00
2009-10-04 10:30:41 +03:00
/** \class cmCTestLaunch
* \brief Launcher for make rules to report results for ctest
*
* This implements the 'ctest --launch' tool.
*/
class cmCTestLaunch
{
public:
/** Entry point from ctest executable main(). */
2012-02-18 12:40:36 +02:00
static int Main(int argc, const char* const argv[]);
2016-07-09 11:21:54 +02:00
2022-03-29 21:10:50 +02:00
cmCTestLaunch(const cmCTestLaunch&) = delete;
cmCTestLaunch& operator=(const cmCTestLaunch&) = delete;
2009-10-04 10:30:41 +03:00
private:
// Initialize the launcher from its command line.
cmCTestLaunch(int argc, const char* const* argv);
~cmCTestLaunch();
// Run the real command.
int Run();
void RunChild();
2021-09-14 00:13:48 +02:00
// Method to check the result of the real command.
2009-10-04 10:30:41 +03:00
bool CheckResults();
2021-09-14 00:13:48 +02:00
// Parse out launcher-specific options specified before the real command.
2009-10-04 10:30:41 +03:00
bool ParseArguments(int argc, const char* const* argv);
// The real command line appearing after launcher arguments.
int RealArgC;
const char* const* RealArgV;
// The real command line after response file expansion.
std::vector<std::string> RealArgs;
void HandleRealArg(const char* arg);
struct cmsysProcess_s* Process;
2021-09-14 00:13:48 +02:00
// Whether or not any data have been written to stdout or stderr.
2009-10-04 10:30:41 +03:00
bool HaveOut;
bool HaveErr;
2021-09-14 00:13:48 +02:00
// Load custom rules to match warnings and their exceptions.
2009-10-04 10:30:41 +03:00
bool ScrapeRulesLoaded;
void LoadScrapeRules();
void LoadScrapeRules(const char* purpose,
2021-09-14 00:13:48 +02:00
std::vector<cmsys::RegularExpression>& regexps) const;
2009-10-04 10:30:41 +03:00
bool ScrapeLog(std::string const& fname);
2021-09-14 00:13:48 +02:00
// Helper class to generate the xml fragment.
cmCTestLaunchReporter Reporter;
2009-10-04 10:30:41 +03:00
// Configuration
void LoadConfig();
};