diff options
author | Regina Pfeifer <regina@mailbox.org> | 2019-03-18 21:25:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-03-20 15:41:29 (GMT) |
commit | a5eeb0310db04aa661dec37f7cc1073e058f3acf (patch) | |
tree | 0398d06f066387e49d6b3b23c0062232dc425c38 /Source | |
parent | 71a3391b5ff95271074cf15a4a5d09ded42a362f (diff) | |
download | CMake-a5eeb0310db04aa661dec37f7cc1073e058f3acf.zip CMake-a5eeb0310db04aa661dec37f7cc1073e058f3acf.tar.gz CMake-a5eeb0310db04aa661dec37f7cc1073e058f3acf.tar.bz2 |
cmCTest: Cleanup typedefs
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.cxx | 10 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitCommand.h | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.h | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestUploadCommand.h | 6 | ||||
-rw-r--r-- | Source/CTest/cmCTestUploadHandler.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestUploadHandler.h | 9 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 36 | ||||
-rw-r--r-- | Source/cmCTest.h | 11 |
9 files changed, 30 insertions, 53 deletions
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx index a3aa7aa..e31d982 100644 --- a/Source/CTest/cmCTestSubmitCommand.cxx +++ b/Source/CTest/cmCTestSubmitCommand.cxx @@ -41,22 +41,16 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler() this->Makefile->GetDefinition("CTEST_NOTES_FILES"); if (notesFilesVariable) { std::vector<std::string> notesFiles; - cmCTest::VectorOfStrings newNotesFiles; cmSystemTools::ExpandListArgument(notesFilesVariable, notesFiles); - newNotesFiles.insert(newNotesFiles.end(), notesFiles.begin(), - notesFiles.end()); - this->CTest->GenerateNotesFile(newNotesFiles); + this->CTest->GenerateNotesFile(notesFiles); } const char* extraFilesVariable = this->Makefile->GetDefinition("CTEST_EXTRA_SUBMIT_FILES"); if (extraFilesVariable) { std::vector<std::string> extraFiles; - cmCTest::VectorOfStrings newExtraFiles; cmSystemTools::ExpandListArgument(extraFilesVariable, extraFiles); - newExtraFiles.insert(newExtraFiles.end(), extraFiles.begin(), - extraFiles.end()); - if (!this->CTest->SubmitExtraFiles(newExtraFiles)) { + if (!this->CTest->SubmitExtraFiles(extraFiles)) { this->SetError("problem submitting extra files."); return nullptr; } diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h index 0caccd6..4b1bb26 100644 --- a/Source/CTest/cmCTestSubmitCommand.h +++ b/Source/CTest/cmCTestSubmitCommand.h @@ -79,7 +79,7 @@ protected: std::set<cmCTest::Part> Parts; bool FilesMentioned; bool InternalTest; - cmCTest::SetOfStrings Files; + std::set<std::string> Files; std::string RetryCount; std::string RetryDelay; bool CDashUpload; diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index c3f7fb4..2b54365 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -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()); } diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h index 58f4f97..e0fed10 100644 --- a/Source/CTest/cmCTestSubmitHandler.h +++ b/Source/CTest/cmCTestSubmitHandler.h @@ -38,7 +38,7 @@ public: void SelectParts(std::set<cmCTest::Part> const& parts); /** 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 int HandleCDashUploadFile(std::string const& file, std::string const& type); @@ -74,7 +74,7 @@ private: bool SubmitPart[cmCTest::PartCount]; bool HasWarnings; bool HasErrors; - cmCTest::SetOfStrings Files; + std::set<std::string> Files; std::vector<std::string> HttpHeaders; }; diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h index 61bf1cc..0d3b06e 100644 --- a/Source/CTest/cmCTestUploadCommand.h +++ b/Source/CTest/cmCTestUploadCommand.h @@ -5,9 +5,9 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include "cmCTest.h" #include "cmCTestHandlerCommand.h" +#include <set> #include <string> class cmCTestGenericHandler; @@ -22,8 +22,6 @@ class cmCommand; class cmCTestUploadCommand : public cmCTestHandlerCommand { public: - cmCTestUploadCommand() {} - /** * This is a virtual constructor for the command. */ @@ -55,7 +53,7 @@ protected: ArgumentDoingLast2 }; - cmCTest::SetOfStrings Files; + std::set<std::string> Files; }; #endif diff --git a/Source/CTest/cmCTestUploadHandler.cxx b/Source/CTest/cmCTestUploadHandler.cxx index 261ecab..ee9ee91 100644 --- a/Source/CTest/cmCTestUploadHandler.cxx +++ b/Source/CTest/cmCTestUploadHandler.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCTestUploadHandler.h" +#include "cmCTest.h" #include "cmGeneratedFileStream.h" #include "cmVersion.h" #include "cmXMLWriter.h" @@ -20,7 +21,7 @@ void cmCTestUploadHandler::Initialize() this->Files.clear(); } -void cmCTestUploadHandler::SetFiles(const cmCTest::SetOfStrings& files) +void cmCTestUploadHandler::SetFiles(std::set<std::string> const& files) { this->Files = files; } diff --git a/Source/CTest/cmCTestUploadHandler.h b/Source/CTest/cmCTestUploadHandler.h index ff50574..4d8fab4 100644 --- a/Source/CTest/cmCTestUploadHandler.h +++ b/Source/CTest/cmCTestUploadHandler.h @@ -5,9 +5,11 @@ #include "cmConfigure.h" // IWYU pragma: keep -#include "cmCTest.h" #include "cmCTestGenericHandler.h" +#include <set> +#include <string> + /** \class cmCTestUploadHandler * \brief Helper class for CTest * @@ -20,7 +22,6 @@ public: typedef cmCTestGenericHandler Superclass; cmCTestUploadHandler(); - ~cmCTestUploadHandler() override {} /* * The main entry point for this class @@ -30,10 +31,10 @@ public: void Initialize() override; /** Specify a set of files to submit. */ - void SetFiles(cmCTest::SetOfStrings const& files); + void SetFiles(std::set<std::string> const& files); private: - cmCTest::SetOfStrings Files; + std::set<std::string> Files; }; #endif diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 91219d0..569e6dd 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -62,13 +62,6 @@ # include <be/kernel/OS.h> /* disable_debugger() API. */ #endif -#define DEBUGOUT \ - std::cout << __LINE__ << " "; \ - std::cout -#define DEBUGERR \ - std::cerr << __LINE__ << " "; \ - std::cerr - struct cmCTest::Private { /** Representation of one part. */ @@ -147,18 +140,15 @@ struct cmCTest::Private bool OutputAsJson = false; int OutputAsJsonVersion = 1; - /** Map of configuration properties */ - typedef std::map<std::string, std::string> CTestConfigurationMap; - // TODO: The ctest configuration should be a hierarchy of // configuration option sources: command-line, script, ini file. // Then the ini file can get re-loaded whenever it changes without // affecting any higher-precedence settings. - CTestConfigurationMap CTestConfiguration; - CTestConfigurationMap CTestConfigurationOverwrites; + std::map<std::string, std::string> CTestConfiguration; + std::map<std::string, std::string> CTestConfigurationOverwrites; + PartInfo Parts[PartCount]; - typedef std::map<std::string, Part> PartMapType; - PartMapType PartMap; + std::map<std::string, Part> PartMap; std::string CurrentTag; bool TomorrowTag = false; @@ -1601,7 +1591,7 @@ void cmCTest::EndXML(cmXMLWriter& xml) } int cmCTest::GenerateCTestNotesOutput(cmXMLWriter& xml, - const cmCTest::VectorOfStrings& files) + std::vector<std::string> const& files) { std::string buildname = cmCTest::SafeBuildIdField(this->GetCTestConfiguration("BuildName")); @@ -1651,7 +1641,7 @@ int cmCTest::GenerateCTestNotesOutput(cmXMLWriter& xml, return 1; } -int cmCTest::GenerateNotesFile(const VectorOfStrings& files) +int cmCTest::GenerateNotesFile(std::vector<std::string> const& files) { cmGeneratedFileStream ofs; if (!this->OpenOutputFile(this->Impl->CurrentTag, "Notes.xml", ofs)) { @@ -1669,11 +1659,10 @@ int cmCTest::GenerateNotesFile(const char* cfiles) return 1; } - VectorOfStrings files; - cmCTestLog(this, OUTPUT, "Create notes file" << std::endl); - files = cmSystemTools::SplitString(cfiles, ';'); + std::vector<std::string> const files = + cmSystemTools::SplitString(cfiles, ';'); if (files.empty()) { return 1; } @@ -1740,7 +1729,7 @@ std::string cmCTest::Base64EncodeFile(std::string const& file) 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) { if (!cmSystemTools::FileExists(file)) { @@ -1760,11 +1749,10 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles) return true; } - VectorOfStrings files; - cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl); - files = cmSystemTools::SplitString(cfiles, ';'); + std::vector<std::string> const files = + cmSystemTools::SplitString(cfiles, ';'); if (files.empty()) { return true; } @@ -2594,8 +2582,6 @@ void cmCTest::SetScheduleType(std::string const& type) int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf) { bool found = false; - VectorOfStrings dirs; - VectorOfStrings ndirs; cmCTestLog(this, DEBUG, "* Read custom CTest configuration directory: " << dir << std::endl); diff --git a/Source/cmCTest.h b/Source/cmCTest.h index d9f7ee0..5f49cbc 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -11,7 +11,6 @@ #include <chrono> #include <map> #include <memory> // IWYU pragma: keep -#include <set> #include <sstream> #include <string> #include <time.h> @@ -81,9 +80,6 @@ public: if the string does not name a valid part. */ Part GetPartFromName(const char* name); - typedef std::vector<std::string> VectorOfStrings; - typedef std::set<std::string> SetOfStrings; - /** Process Command line arguments */ int Run(std::vector<std::string>&, std::string* output = nullptr); @@ -365,14 +361,14 @@ public: void AddCTestConfigurationOverwrite(const std::string& encstr); /** 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 */ int GenerateDoneFile(); /** Submit extra files to the server */ bool SubmitExtraFiles(const char* files); - bool SubmitExtraFiles(const VectorOfStrings& files); + bool SubmitExtraFiles(std::vector<std::string> const& files); /** Set the output log file name */ void SetOutputLogFileName(const char* name); @@ -511,7 +507,8 @@ private: bool UpdateCTestConfiguration(); /** 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 */ bool CheckArgument(const std::string& arg, const char* varg1, |