diff options
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 20ef693..cd250fb 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -42,7 +42,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + cmCommand* Clone() CM_OVERRIDE { cmCTestSubdirCommand* c = new cmCTestSubdirCommand; c->TestHandler = this->TestHandler; @@ -53,13 +53,13 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector<std::string> const& args, - cmExecutionStatus&); + bool InitialPass(std::vector<std::string> const& args, + cmExecutionStatus&) CM_OVERRIDE; /** * The name of the command as specified in CMakeList.txt. */ - virtual std::string GetName() const { return "subdirs"; } + std::string GetName() const CM_OVERRIDE { return "subdirs"; } cmTypeMacro(cmCTestSubdirCommand, cmCommand); @@ -69,7 +69,7 @@ public: bool cmCTestSubdirCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } @@ -123,7 +123,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + cmCommand* Clone() CM_OVERRIDE { cmCTestAddSubdirectoryCommand* c = new cmCTestAddSubdirectoryCommand; c->TestHandler = this->TestHandler; @@ -134,13 +134,13 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector<std::string> const& args, - cmExecutionStatus&); + bool InitialPass(std::vector<std::string> const& args, + cmExecutionStatus&) CM_OVERRIDE; /** * The name of the command as specified in CMakeList.txt. */ - virtual std::string GetName() const { return "add_subdirectory"; } + std::string GetName() const CM_OVERRIDE { return "add_subdirectory"; } cmTypeMacro(cmCTestAddSubdirectoryCommand, cmCommand); @@ -150,7 +150,7 @@ public: bool cmCTestAddSubdirectoryCommand::InitialPass( std::vector<std::string> const& args, cmExecutionStatus&) { - if (args.size() < 1) { + if (args.empty()) { this->SetError("called with incorrect number of arguments"); return false; } @@ -197,7 +197,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + cmCommand* Clone() CM_OVERRIDE { cmCTestAddTestCommand* c = new cmCTestAddTestCommand; c->TestHandler = this->TestHandler; @@ -208,13 +208,13 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector<std::string> const&, - cmExecutionStatus&); + bool InitialPass(std::vector<std::string> const&, + cmExecutionStatus&) CM_OVERRIDE; /** * The name of the command as specified in CMakeList.txt. */ - virtual std::string GetName() const { return "add_test"; } + std::string GetName() const CM_OVERRIDE { return "add_test"; } cmTypeMacro(cmCTestAddTestCommand, cmCommand); @@ -237,7 +237,7 @@ public: /** * This is a virtual constructor for the command. */ - virtual cmCommand* Clone() + cmCommand* Clone() CM_OVERRIDE { cmCTestSetTestsPropertiesCommand* c = new cmCTestSetTestsPropertiesCommand; c->TestHandler = this->TestHandler; @@ -248,13 +248,13 @@ public: * This is called when the command is first encountered in * the CMakeLists.txt file. */ - virtual bool InitialPass(std::vector<std::string> const&, - cmExecutionStatus&); + bool InitialPass(std::vector<std::string> const&, + cmExecutionStatus&) CM_OVERRIDE; /** * The name of the command as specified in CMakeList.txt. */ - virtual std::string GetName() const { return "set_tests_properties"; } + std::string GetName() const CM_OVERRIDE { return "set_tests_properties"; } cmTypeMacro(cmCTestSetTestsPropertiesCommand, cmCommand); @@ -336,7 +336,7 @@ cmCTestTestHandler::cmCTestTestHandler() this->MemCheck = false; - this->LogFile = 0; + this->LogFile = CM_NULLPTR; // regex to detect <DartMeasurement>...</DartMeasurement> this->DartStuff.compile("(<DartMeasurement.*/DartMeasurement[a-zA-Z]*>)"); @@ -550,7 +550,7 @@ int cmCTestTestHandler::ProcessHandler() cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create " << (this->MemCheck ? "memory check" : "testing") << " XML file" << std::endl); - this->LogFile = 0; + this->LogFile = CM_NULLPTR; return 1; } cmXMLWriter xml(xmlfile); @@ -558,15 +558,15 @@ int cmCTestTestHandler::ProcessHandler() } if (!this->PostProcessHandler()) { - this->LogFile = 0; + this->LogFile = CM_NULLPTR; return -1; } if (!failed.empty()) { - this->LogFile = 0; + this->LogFile = CM_NULLPTR; return -1; } - this->LogFile = 0; + this->LogFile = CM_NULLPTR; return 0; } @@ -936,7 +936,7 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<std::string>& passed, bool randomSchedule = this->CTest->GetScheduleType() == "Random"; if (randomSchedule) { - srand((unsigned)time(0)); + srand((unsigned)time(CM_NULLPTR)); } for (ListOfTests::iterator it = this->TestList.begin(); @@ -1125,7 +1125,7 @@ void cmCTestTestHandler::AttachFiles(cmXMLWriter& xml, cmCTestTestResult* result) { if (result->Status != cmCTestTestHandler::COMPLETED && - result->Properties->AttachOnFail.size()) { + !result->Properties->AttachOnFail.empty()) { result->Properties->AttachedFiles.insert( result->Properties->AttachedFiles.end(), result->Properties->AttachOnFail.begin(), @@ -1154,7 +1154,8 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<std::string>& vec) int retVal = 0; cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it << std::endl, this->Quiet); - if (!cmSystemTools::RunSingleCommand(it->c_str(), 0, 0, &retVal, 0, + if (!cmSystemTools::RunSingleCommand(it->c_str(), CM_NULLPTR, CM_NULLPTR, + &retVal, CM_NULLPTR, cmSystemTools::OUTPUT_MERGE /*this->Verbose*/) || retVal != 0) { @@ -1321,7 +1322,7 @@ std::string cmCTestTestHandler::FindExecutable( << "Looked in the following places:\n"); for (std::vector<std::string>::iterator i = failed.begin(); i != failed.end(); ++i) { - cmCTestLog(ctest, HANDLER_OUTPUT, i->c_str() << "\n"); + cmCTestLog(ctest, HANDLER_OUTPUT, *i << "\n"); } } @@ -1351,7 +1352,7 @@ void cmCTestTestHandler::GetListOfTests() cm.SetHomeOutputDirectory(""); cm.GetCurrentSnapshot().SetDefaultDefinitions(); cmGlobalGenerator gg(&cm); - cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); + CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); mf->AddDefinition("CTEST_CONFIGURATION_TYPE", this->CTest->GetConfigType().c_str()); @@ -1406,7 +1407,7 @@ void cmCTestTestHandler::UseIncludeRegExp() void cmCTestTestHandler::UseExcludeRegExp() { this->UseExcludeRegExpFlag = true; - this->UseExcludeRegExpFirst = this->UseIncludeRegExpFlag ? false : true; + this->UseExcludeRegExpFirst = !this->UseIncludeRegExpFlag; } const char* cmCTestTestHandler::GetTestStatus(int status) @@ -1677,7 +1678,7 @@ void cmCTestTestHandler::GenerateRegressionImages(cmXMLWriter& xml, xml.Attribute(measurementfile.match(3).c_str(), measurementfile.match(4)); xml.Attribute("encoding", "base64"); - std::stringstream ostr; + std::ostringstream ostr; for (size_t cc = 0; cc < rlen; cc++) { ostr << encoded_buffer[cc]; if (cc % 60 == 0 && cc) { |