mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 23:19:58 -06:00
cmCTest: Cleanup typedefs
This commit is contained in:
committed by
Brad King
parent
71a3391b5f
commit
a5eeb0310d
@@ -41,22 +41,16 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
|
|||||||
this->Makefile->GetDefinition("CTEST_NOTES_FILES");
|
this->Makefile->GetDefinition("CTEST_NOTES_FILES");
|
||||||
if (notesFilesVariable) {
|
if (notesFilesVariable) {
|
||||||
std::vector<std::string> notesFiles;
|
std::vector<std::string> notesFiles;
|
||||||
cmCTest::VectorOfStrings newNotesFiles;
|
|
||||||
cmSystemTools::ExpandListArgument(notesFilesVariable, notesFiles);
|
cmSystemTools::ExpandListArgument(notesFilesVariable, notesFiles);
|
||||||
newNotesFiles.insert(newNotesFiles.end(), notesFiles.begin(),
|
this->CTest->GenerateNotesFile(notesFiles);
|
||||||
notesFiles.end());
|
|
||||||
this->CTest->GenerateNotesFile(newNotesFiles);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* extraFilesVariable =
|
const char* extraFilesVariable =
|
||||||
this->Makefile->GetDefinition("CTEST_EXTRA_SUBMIT_FILES");
|
this->Makefile->GetDefinition("CTEST_EXTRA_SUBMIT_FILES");
|
||||||
if (extraFilesVariable) {
|
if (extraFilesVariable) {
|
||||||
std::vector<std::string> extraFiles;
|
std::vector<std::string> extraFiles;
|
||||||
cmCTest::VectorOfStrings newExtraFiles;
|
|
||||||
cmSystemTools::ExpandListArgument(extraFilesVariable, extraFiles);
|
cmSystemTools::ExpandListArgument(extraFilesVariable, extraFiles);
|
||||||
newExtraFiles.insert(newExtraFiles.end(), extraFiles.begin(),
|
if (!this->CTest->SubmitExtraFiles(extraFiles)) {
|
||||||
extraFiles.end());
|
|
||||||
if (!this->CTest->SubmitExtraFiles(newExtraFiles)) {
|
|
||||||
this->SetError("problem submitting extra files.");
|
this->SetError("problem submitting extra files.");
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ protected:
|
|||||||
std::set<cmCTest::Part> Parts;
|
std::set<cmCTest::Part> Parts;
|
||||||
bool FilesMentioned;
|
bool FilesMentioned;
|
||||||
bool InternalTest;
|
bool InternalTest;
|
||||||
cmCTest::SetOfStrings Files;
|
std::set<std::string> Files;
|
||||||
std::string RetryCount;
|
std::string RetryCount;
|
||||||
std::string RetryDelay;
|
std::string RetryDelay;
|
||||||
bool CDashUpload;
|
bool CDashUpload;
|
||||||
|
|||||||
@@ -900,7 +900,7 @@ void cmCTestSubmitHandler::SelectParts(std::set<cmCTest::Part> const& parts)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCTestSubmitHandler::SelectFiles(cmCTest::SetOfStrings const& files)
|
void cmCTestSubmitHandler::SelectFiles(std::set<std::string> const& files)
|
||||||
{
|
{
|
||||||
this->Files.insert(files.begin(), files.end());
|
this->Files.insert(files.begin(), files.end());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
void SelectParts(std::set<cmCTest::Part> const& parts);
|
void SelectParts(std::set<cmCTest::Part> const& parts);
|
||||||
|
|
||||||
/** Specify a set of files to submit. */
|
/** Specify a set of files to submit. */
|
||||||
void SelectFiles(cmCTest::SetOfStrings const& files);
|
void SelectFiles(std::set<std::string> const& files);
|
||||||
|
|
||||||
// handle the cdash file upload protocol
|
// handle the cdash file upload protocol
|
||||||
int HandleCDashUploadFile(std::string const& file, std::string const& type);
|
int HandleCDashUploadFile(std::string const& file, std::string const& type);
|
||||||
@@ -74,7 +74,7 @@ private:
|
|||||||
bool SubmitPart[cmCTest::PartCount];
|
bool SubmitPart[cmCTest::PartCount];
|
||||||
bool HasWarnings;
|
bool HasWarnings;
|
||||||
bool HasErrors;
|
bool HasErrors;
|
||||||
cmCTest::SetOfStrings Files;
|
std::set<std::string> Files;
|
||||||
std::vector<std::string> HttpHeaders;
|
std::vector<std::string> HttpHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
#include "cmConfigure.h" // IWYU pragma: keep
|
#include "cmConfigure.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include "cmCTest.h"
|
|
||||||
#include "cmCTestHandlerCommand.h"
|
#include "cmCTestHandlerCommand.h"
|
||||||
|
|
||||||
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class cmCTestGenericHandler;
|
class cmCTestGenericHandler;
|
||||||
@@ -22,8 +22,6 @@ class cmCommand;
|
|||||||
class cmCTestUploadCommand : public cmCTestHandlerCommand
|
class cmCTestUploadCommand : public cmCTestHandlerCommand
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmCTestUploadCommand() {}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a virtual constructor for the command.
|
* This is a virtual constructor for the command.
|
||||||
*/
|
*/
|
||||||
@@ -55,7 +53,7 @@ protected:
|
|||||||
ArgumentDoingLast2
|
ArgumentDoingLast2
|
||||||
};
|
};
|
||||||
|
|
||||||
cmCTest::SetOfStrings Files;
|
std::set<std::string> Files;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||||
#include "cmCTestUploadHandler.h"
|
#include "cmCTestUploadHandler.h"
|
||||||
|
|
||||||
|
#include "cmCTest.h"
|
||||||
#include "cmGeneratedFileStream.h"
|
#include "cmGeneratedFileStream.h"
|
||||||
#include "cmVersion.h"
|
#include "cmVersion.h"
|
||||||
#include "cmXMLWriter.h"
|
#include "cmXMLWriter.h"
|
||||||
@@ -20,7 +21,7 @@ void cmCTestUploadHandler::Initialize()
|
|||||||
this->Files.clear();
|
this->Files.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmCTestUploadHandler::SetFiles(const cmCTest::SetOfStrings& files)
|
void cmCTestUploadHandler::SetFiles(std::set<std::string> const& files)
|
||||||
{
|
{
|
||||||
this->Files = files;
|
this->Files = files;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
|
|
||||||
#include "cmConfigure.h" // IWYU pragma: keep
|
#include "cmConfigure.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include "cmCTest.h"
|
|
||||||
#include "cmCTestGenericHandler.h"
|
#include "cmCTestGenericHandler.h"
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
/** \class cmCTestUploadHandler
|
/** \class cmCTestUploadHandler
|
||||||
* \brief Helper class for CTest
|
* \brief Helper class for CTest
|
||||||
*
|
*
|
||||||
@@ -20,7 +22,6 @@ public:
|
|||||||
typedef cmCTestGenericHandler Superclass;
|
typedef cmCTestGenericHandler Superclass;
|
||||||
|
|
||||||
cmCTestUploadHandler();
|
cmCTestUploadHandler();
|
||||||
~cmCTestUploadHandler() override {}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The main entry point for this class
|
* The main entry point for this class
|
||||||
@@ -30,10 +31,10 @@ public:
|
|||||||
void Initialize() override;
|
void Initialize() override;
|
||||||
|
|
||||||
/** Specify a set of files to submit. */
|
/** Specify a set of files to submit. */
|
||||||
void SetFiles(cmCTest::SetOfStrings const& files);
|
void SetFiles(std::set<std::string> const& files);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cmCTest::SetOfStrings Files;
|
std::set<std::string> Files;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -62,13 +62,6 @@
|
|||||||
# include <be/kernel/OS.h> /* disable_debugger() API. */
|
# include <be/kernel/OS.h> /* disable_debugger() API. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEBUGOUT \
|
|
||||||
std::cout << __LINE__ << " "; \
|
|
||||||
std::cout
|
|
||||||
#define DEBUGERR \
|
|
||||||
std::cerr << __LINE__ << " "; \
|
|
||||||
std::cerr
|
|
||||||
|
|
||||||
struct cmCTest::Private
|
struct cmCTest::Private
|
||||||
{
|
{
|
||||||
/** Representation of one part. */
|
/** Representation of one part. */
|
||||||
@@ -147,18 +140,15 @@ struct cmCTest::Private
|
|||||||
bool OutputAsJson = false;
|
bool OutputAsJson = false;
|
||||||
int OutputAsJsonVersion = 1;
|
int OutputAsJsonVersion = 1;
|
||||||
|
|
||||||
/** Map of configuration properties */
|
|
||||||
typedef std::map<std::string, std::string> CTestConfigurationMap;
|
|
||||||
|
|
||||||
// TODO: The ctest configuration should be a hierarchy of
|
// TODO: The ctest configuration should be a hierarchy of
|
||||||
// configuration option sources: command-line, script, ini file.
|
// configuration option sources: command-line, script, ini file.
|
||||||
// Then the ini file can get re-loaded whenever it changes without
|
// Then the ini file can get re-loaded whenever it changes without
|
||||||
// affecting any higher-precedence settings.
|
// affecting any higher-precedence settings.
|
||||||
CTestConfigurationMap CTestConfiguration;
|
std::map<std::string, std::string> CTestConfiguration;
|
||||||
CTestConfigurationMap CTestConfigurationOverwrites;
|
std::map<std::string, std::string> CTestConfigurationOverwrites;
|
||||||
|
|
||||||
PartInfo Parts[PartCount];
|
PartInfo Parts[PartCount];
|
||||||
typedef std::map<std::string, Part> PartMapType;
|
std::map<std::string, Part> PartMap;
|
||||||
PartMapType PartMap;
|
|
||||||
|
|
||||||
std::string CurrentTag;
|
std::string CurrentTag;
|
||||||
bool TomorrowTag = false;
|
bool TomorrowTag = false;
|
||||||
@@ -1601,7 +1591,7 @@ void cmCTest::EndXML(cmXMLWriter& xml)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int cmCTest::GenerateCTestNotesOutput(cmXMLWriter& xml,
|
int cmCTest::GenerateCTestNotesOutput(cmXMLWriter& xml,
|
||||||
const cmCTest::VectorOfStrings& files)
|
std::vector<std::string> const& files)
|
||||||
{
|
{
|
||||||
std::string buildname =
|
std::string buildname =
|
||||||
cmCTest::SafeBuildIdField(this->GetCTestConfiguration("BuildName"));
|
cmCTest::SafeBuildIdField(this->GetCTestConfiguration("BuildName"));
|
||||||
@@ -1651,7 +1641,7 @@ int cmCTest::GenerateCTestNotesOutput(cmXMLWriter& xml,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCTest::GenerateNotesFile(const VectorOfStrings& files)
|
int cmCTest::GenerateNotesFile(std::vector<std::string> const& files)
|
||||||
{
|
{
|
||||||
cmGeneratedFileStream ofs;
|
cmGeneratedFileStream ofs;
|
||||||
if (!this->OpenOutputFile(this->Impl->CurrentTag, "Notes.xml", ofs)) {
|
if (!this->OpenOutputFile(this->Impl->CurrentTag, "Notes.xml", ofs)) {
|
||||||
@@ -1669,11 +1659,10 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorOfStrings files;
|
|
||||||
|
|
||||||
cmCTestLog(this, OUTPUT, "Create notes file" << std::endl);
|
cmCTestLog(this, OUTPUT, "Create notes file" << std::endl);
|
||||||
|
|
||||||
files = cmSystemTools::SplitString(cfiles, ';');
|
std::vector<std::string> const files =
|
||||||
|
cmSystemTools::SplitString(cfiles, ';');
|
||||||
if (files.empty()) {
|
if (files.empty()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -1740,7 +1729,7 @@ std::string cmCTest::Base64EncodeFile(std::string const& file)
|
|||||||
return std::string(&encoded_buffer[0], rlen);
|
return std::string(&encoded_buffer[0], rlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmCTest::SubmitExtraFiles(const VectorOfStrings& files)
|
bool cmCTest::SubmitExtraFiles(std::vector<std::string> const& files)
|
||||||
{
|
{
|
||||||
for (std::string const& file : files) {
|
for (std::string const& file : files) {
|
||||||
if (!cmSystemTools::FileExists(file)) {
|
if (!cmSystemTools::FileExists(file)) {
|
||||||
@@ -1760,11 +1749,10 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorOfStrings files;
|
|
||||||
|
|
||||||
cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl);
|
cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl);
|
||||||
|
|
||||||
files = cmSystemTools::SplitString(cfiles, ';');
|
std::vector<std::string> const files =
|
||||||
|
cmSystemTools::SplitString(cfiles, ';');
|
||||||
if (files.empty()) {
|
if (files.empty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -2594,8 +2582,6 @@ void cmCTest::SetScheduleType(std::string const& type)
|
|||||||
int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
|
int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
VectorOfStrings dirs;
|
|
||||||
VectorOfStrings ndirs;
|
|
||||||
cmCTestLog(this, DEBUG,
|
cmCTestLog(this, DEBUG,
|
||||||
"* Read custom CTest configuration directory: " << dir
|
"* Read custom CTest configuration directory: " << dir
|
||||||
<< std::endl);
|
<< std::endl);
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory> // IWYU pragma: keep
|
#include <memory> // IWYU pragma: keep
|
||||||
#include <set>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -81,9 +80,6 @@ public:
|
|||||||
if the string does not name a valid part. */
|
if the string does not name a valid part. */
|
||||||
Part GetPartFromName(const char* name);
|
Part GetPartFromName(const char* name);
|
||||||
|
|
||||||
typedef std::vector<std::string> VectorOfStrings;
|
|
||||||
typedef std::set<std::string> SetOfStrings;
|
|
||||||
|
|
||||||
/** Process Command line arguments */
|
/** Process Command line arguments */
|
||||||
int Run(std::vector<std::string>&, std::string* output = nullptr);
|
int Run(std::vector<std::string>&, std::string* output = nullptr);
|
||||||
|
|
||||||
@@ -365,14 +361,14 @@ public:
|
|||||||
void AddCTestConfigurationOverwrite(const std::string& encstr);
|
void AddCTestConfigurationOverwrite(const std::string& encstr);
|
||||||
|
|
||||||
/** Create XML file that contains all the notes specified */
|
/** Create XML file that contains all the notes specified */
|
||||||
int GenerateNotesFile(const VectorOfStrings& files);
|
int GenerateNotesFile(std::vector<std::string> const& files);
|
||||||
|
|
||||||
/** Create XML file to indicate that build is complete */
|
/** Create XML file to indicate that build is complete */
|
||||||
int GenerateDoneFile();
|
int GenerateDoneFile();
|
||||||
|
|
||||||
/** Submit extra files to the server */
|
/** Submit extra files to the server */
|
||||||
bool SubmitExtraFiles(const char* files);
|
bool SubmitExtraFiles(const char* files);
|
||||||
bool SubmitExtraFiles(const VectorOfStrings& files);
|
bool SubmitExtraFiles(std::vector<std::string> const& files);
|
||||||
|
|
||||||
/** Set the output log file name */
|
/** Set the output log file name */
|
||||||
void SetOutputLogFileName(const char* name);
|
void SetOutputLogFileName(const char* name);
|
||||||
@@ -511,7 +507,8 @@ private:
|
|||||||
bool UpdateCTestConfiguration();
|
bool UpdateCTestConfiguration();
|
||||||
|
|
||||||
/** Create note from files. */
|
/** Create note from files. */
|
||||||
int GenerateCTestNotesOutput(cmXMLWriter& xml, const VectorOfStrings& files);
|
int GenerateCTestNotesOutput(cmXMLWriter& xml,
|
||||||
|
std::vector<std::string> const& files);
|
||||||
|
|
||||||
/** Check if the argument is the one specified */
|
/** Check if the argument is the one specified */
|
||||||
bool CheckArgument(const std::string& arg, const char* varg1,
|
bool CheckArgument(const std::string& arg, const char* varg1,
|
||||||
|
|||||||
Reference in New Issue
Block a user