summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestLaunch.h
diff options
context:
space:
mode:
authorZack Galbreath <zack.galbreath@kitware.com>2020-09-23 14:27:25 (GMT)
committerZack Galbreath <zack.galbreath@kitware.com>2020-09-28 17:13:52 (GMT)
commit56e4e942d22bddc1662d5a3d057ab8246b805c32 (patch)
treeeda5357cbdc3f8cca00c00e34d72aec252ec322c /Source/CTest/cmCTestLaunch.h
parentdd0743fdf80016096077e7689fe8698ab1159098 (diff)
downloadCMake-56e4e942d22bddc1662d5a3d057ab8246b805c32.zip
CMake-56e4e942d22bddc1662d5a3d057ab8246b805c32.tar.gz
CMake-56e4e942d22bddc1662d5a3d057ab8246b805c32.tar.bz2
ctest: split launcher XML writer into separate class
This refactor will allow us to more easily add additional warnings and errors to builds that use launchers.
Diffstat (limited to 'Source/CTest/cmCTestLaunch.h')
-rw-r--r--Source/CTest/cmCTestLaunch.h55
1 files changed, 11 insertions, 44 deletions
diff --git a/Source/CTest/cmCTestLaunch.h b/Source/CTest/cmCTestLaunch.h
index 33ff82c..d18f66d 100644
--- a/Source/CTest/cmCTestLaunch.h
+++ b/Source/CTest/cmCTestLaunch.h
@@ -4,13 +4,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <set>
#include <string>
#include <vector>
-#include "cmsys/RegularExpression.hxx"
+#include "cmCTestLaunchReporter.h"
-class cmXMLElement;
+namespace cmsys {
+class RegularExpression;
+}
/** \class cmCTestLaunch
* \brief Launcher for make rules to report results for ctest
@@ -35,70 +36,36 @@ private:
int Run();
void RunChild();
- // Methods to check the result of the real command.
- bool IsError() const;
+ // Method to check the result of the real command.
bool CheckResults();
- // Launcher options specified before the real command.
- std::string OptionOutput;
- std::string OptionSource;
- std::string OptionLanguage;
- std::string OptionTargetName;
- std::string OptionTargetType;
- std::string OptionBuildDir;
- std::string OptionFilterPrefix;
+ // Parse out launcher-specific options specified before the real command.
bool ParseArguments(int argc, const char* const* argv);
// The real command line appearing after launcher arguments.
int RealArgC;
const char* const* RealArgV;
- std::string CWD;
// The real command line after response file expansion.
std::vector<std::string> RealArgs;
void HandleRealArg(const char* arg);
- // A hash of the real command line is unique and unlikely to collide.
- std::string LogHash;
- void ComputeFileNames();
-
- bool Passthru;
struct cmsysProcess_s* Process;
- int ExitCode;
- // Temporary log files for stdout and stderr of real command.
- std::string LogDir;
- std::string LogOut;
- std::string LogErr;
+ // Whether or not any data have been written to stdout or stderr.
bool HaveOut;
bool HaveErr;
- // Labels associated with the build rule.
- std::set<std::string> Labels;
- void LoadLabels();
- bool SourceMatches(std::string const& lhs, std::string const& rhs);
-
- // Regular expressions to match warnings and their exceptions.
+ // Load custom rules to match warnings and their exceptions.
bool ScrapeRulesLoaded;
- std::vector<cmsys::RegularExpression> RegexWarning;
- std::vector<cmsys::RegularExpression> RegexWarningSuppress;
void LoadScrapeRules();
void LoadScrapeRules(const char* purpose,
std::vector<cmsys::RegularExpression>& regexps);
bool ScrapeLog(std::string const& fname);
- bool Match(std::string const& line,
- std::vector<cmsys::RegularExpression>& regexps);
- bool MatchesFilterPrefix(std::string const& line) const;
-
- // Methods to generate the xml fragment.
- void WriteXML();
- void WriteXMLAction(cmXMLElement&);
- void WriteXMLCommand(cmXMLElement&);
- void WriteXMLResult(cmXMLElement&);
- void WriteXMLLabels(cmXMLElement&);
- void DumpFileToXML(cmXMLElement&, const char* tag, std::string const& fname);
+
+ // Helper class to generate the xml fragment.
+ cmCTestLaunchReporter Reporter;
// Configuration
void LoadConfig();
- std::string SourceDir;
};