/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying1file LICENSE.rst or https://cmake.org/licensing for details. */2#pragma once34#include "cmConfigure.h" // IWYU pragma: keep56#include <string>7#include <vector>89#include "cmCTestLaunchReporter.h"1011namespace cmsys {12class RegularExpression;13}1415/** \class cmCTestLaunch16* \brief Launcher for make rules to report results for ctest17*18* This implements the 'ctest --launch' tool.19*/20class cmCTestLaunch21{2223public:24enum class Op25{26Normal,27Instrument,28};2930/** Entry point from ctest executable main(). */31static int Main(int argc, char const* const argv[], Op operation);3233cmCTestLaunch(cmCTestLaunch const&) = delete;34cmCTestLaunch& operator=(cmCTestLaunch const&) = delete;3536private:37// Initialize the launcher from its command line.38cmCTestLaunch(int argc, char const* const* argv, Op operation);39~cmCTestLaunch();4041// Run the real command.42int Run();43void RunChild();4445// Method to check the result of the real command.46bool CheckResults();4748// Parse out launcher-specific options specified before the real command.49bool ParseArguments(int argc, char const* const* argv);5051// The real command line appearing after launcher arguments.52std::vector<std::string> RealArgV;5354// The real command line after response file expansion.55std::vector<std::string> RealArgs;56void HandleRealArg(char const* arg);5758// Whether or not any data have been written to stdout or stderr.59bool HaveOut;60bool HaveErr;6162// Load custom rules to match warnings and their exceptions.63bool ScrapeRulesLoaded;64void LoadScrapeRules();65void LoadScrapeRules(char const* purpose,66std::vector<cmsys::RegularExpression>& regexps) const;67bool ScrapeLog(std::string const& fname);6869// Helper class to generate the xml fragment.70cmCTestLaunchReporter Reporter;7172// Configuration73void LoadConfig();7475// Mode76Op Operation;77};787980