summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestHandler.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx82
1 files changed, 41 insertions, 41 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 3a04b33..1d1dde4 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -60,7 +60,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "subdirs";}
+ virtual std::string GetName() const { return "subdirs";}
cmTypeMacro(cmCTestSubdirCommand, cmCommand);
@@ -125,7 +125,7 @@ bool cmCTestSubdirCommand
{
std::string m = "Could not find include file: ";
m += fname;
- this->SetError(m.c_str());
+ this->SetError(m);
return false;
}
}
@@ -157,7 +157,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "add_subdirectory";}
+ virtual std::string GetName() const { return "add_subdirectory";}
cmTypeMacro(cmCTestAddSubdirectoryCommand, cmCommand);
@@ -213,7 +213,7 @@ bool cmCTestAddSubdirectoryCommand
{
std::string m = "Could not find include file: ";
m += fname;
- this->SetError(m.c_str());
+ this->SetError(m);
return false;
}
return true;
@@ -243,7 +243,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "add_test";}
+ virtual std::string GetName() const { return "add_test";}
cmTypeMacro(cmCTestAddTestCommand, cmCommand);
@@ -287,7 +287,7 @@ public:
/**
* The name of the command as specified in CMakeList.txt.
*/
- virtual const char* GetName() const { return "set_tests_properties";}
+ virtual std::string GetName() const { return "set_tests_properties";}
cmTypeMacro(cmCTestSetTestsPropertiesCommand, cmCommand);
@@ -540,8 +540,8 @@ int cmCTestTestHandler::ProcessHandler()
this->StartLogFile((this->MemCheck ? "DynamicAnalysis" : "Test"), mLogFile);
this->LogFile = &mLogFile;
- std::vector<cmStdString> passed;
- std::vector<cmStdString> failed;
+ std::vector<std::string> passed;
+ std::vector<std::string> failed;
int total;
//start the real time clock
@@ -569,7 +569,7 @@ int cmCTestTestHandler::ProcessHandler()
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
<< "The following tests passed:" << std::endl);
- for(std::vector<cmStdString>::iterator j = passed.begin();
+ for(std::vector<std::string>::iterator j = passed.begin();
j != passed.end(); ++j)
{
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "\t" << *j
@@ -616,7 +616,7 @@ int cmCTestTestHandler::ProcessHandler()
ofs << ftit->TestCount << ":" << ftit->Name << std::endl;
cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t" << std::setw(3)
<< ftit->TestCount << " - "
- << ftit->Name.c_str() << " ("
+ << ftit->Name << " ("
<< this->GetTestStatus(ftit->Status) << ")"
<< std::endl);
}
@@ -661,8 +661,8 @@ void cmCTestTestHandler::PrintLabelSummary()
cmCTestTestHandler::ListOfTests::iterator it = this->TestList.begin();
cmCTestTestHandler::TestResultsVector::iterator ri =
this->TestResults.begin();
- std::map<cmStdString, double> labelTimes;
- std::set<cmStdString> labels;
+ std::map<std::string, double> labelTimes;
+ std::set<std::string> labels;
// initialize maps
std::string::size_type maxlen = 0;
for(; it != this->TestList.end(); ++it)
@@ -702,7 +702,7 @@ void cmCTestTestHandler::PrintLabelSummary()
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nLabel Time Summary:");
}
- for(std::set<cmStdString>::const_iterator i = labels.begin();
+ for(std::set<std::string>::const_iterator i = labels.begin();
i != labels.end(); ++i)
{
std::string label = *i;
@@ -1022,7 +1022,7 @@ bool cmCTestTestHandler::GetValue(const char* tag,
{
cmCTestLog(this->CTest, ERROR_MESSAGE,
"parse error: missing tag: "
- << tag << " found [" << line.c_str() << "]" << std::endl);
+ << tag << " found [" << line << "]" << std::endl);
ret = false;
}
return ret;
@@ -1050,8 +1050,8 @@ bool cmCTestTestHandler::GetValue(const char* tag,
}
//---------------------------------------------------------------------
-void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
- std::vector<cmStdString> &failed)
+void cmCTestTestHandler::ProcessDirectory(std::vector<std::string> &passed,
+ std::vector<std::string> &failed)
{
this->ComputeTestList();
this->StartTest = this->CTest->CurrentTime();
@@ -1216,14 +1216,14 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os)
<< "name=\"Command Line\"><Value>"
<< cmXMLSafe(result->FullCommandLine)
<< "</Value></NamedMeasurement>\n";
- std::map<cmStdString,cmStdString>::iterator measureIt;
+ std::map<std::string,std::string>::iterator measureIt;
for ( measureIt = result->Properties->Measurements.begin();
measureIt != result->Properties->Measurements.end();
++ measureIt )
{
os
<< "\t\t\t<NamedMeasurement type=\"text/string\" "
- << "name=\"" << measureIt->first.c_str() << "\"><Value>"
+ << "name=\"" << measureIt->first << "\"><Value>"
<< cmXMLSafe(measureIt->second)
<< "</Value></NamedMeasurement>\n";
}
@@ -1328,9 +1328,9 @@ void cmCTestTestHandler::AttachFiles(std::ostream& os,
}
//----------------------------------------------------------------------
-int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
+int cmCTestTestHandler::ExecuteCommands(std::vector<std::string>& vec)
{
- std::vector<cmStdString>::iterator it;
+ std::vector<std::string>::iterator it;
for ( it = vec.begin(); it != vec.end(); ++it )
{
int retVal = 0;
@@ -1506,7 +1506,7 @@ std::string cmCTestTestHandler
// then try with the exe extension
else
{
- failed.push_back(attempted[ai].c_str());
+ failed.push_back(attempted[ai]);
tempPath = attempted[ai];
tempPath += cmSystemTools::GetExecutableExtension();
if(cmSystemTools::FileExists(tempPath.c_str())
@@ -1517,7 +1517,7 @@ std::string cmCTestTestHandler
}
else
{
- failed.push_back(tempPath.c_str());
+ failed.push_back(tempPath);
}
}
}
@@ -1820,7 +1820,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed()
else if ( !this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels() )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "Problem reading file: "
- << lastTestsFailedLog.c_str() <<
+ << lastTestsFailedLog <<
" while generating list of previously failed tests." << std::endl);
}
}
@@ -1960,7 +1960,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages(
<< " " << k1 << "=\"" << v1 << "\""
<< " " << k2 << "=\"" << v2 << "\""
<< " encoding=\"none\""
- << "><Value>Image " << filename.c_str()
+ << "><Value>Image " << filename
<< " is empty</Value></NamedMeasurement>";
}
else
@@ -2014,10 +2014,10 @@ std::string cmCTestTestHandler::GenerateRegressionImages(
<< "\t\t\t<NamedMeasurement"
<< " name=\"" << measurementfile.match(idx) << "\""
<< " text=\"text/string\""
- << "><Value>File " << filename.c_str()
+ << "><Value>File " << filename
<< " not found</Value></NamedMeasurement>"
<< std::endl;
- cmCTestLog(this->CTest, HANDLER_OUTPUT, "File \"" << filename.c_str()
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, "File \"" << filename
<< "\" not found." << std::endl);
}
cxml.erase(measurementfile.start(),
@@ -2112,7 +2112,7 @@ bool cmCTestTestHandler::SetTestsProperties(
const std::vector<std::string>& args)
{
std::vector<std::string>::const_iterator it;
- std::vector<cmStdString> tests;
+ std::vector<std::string> tests;
bool found = false;
for ( it = args.begin(); it != args.end(); ++ it )
{
@@ -2137,7 +2137,7 @@ bool cmCTestTestHandler::SetTestsProperties(
break;
}
std::string val = *it;
- std::vector<cmStdString>::const_iterator tit;
+ std::vector<std::string>::const_iterator tit;
for ( tit = tests.begin(); tit != tests.end(); ++ tit )
{
cmCTestTestHandler::ListOfTests::iterator rtit;
@@ -2154,7 +2154,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "ATTACHED_FILES" )
{
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val.c_str(), lval);
+ cmSystemTools::ExpandListArgument(val, lval);
for(std::vector<std::string>::iterator f = lval.begin();
f != lval.end(); ++f)
@@ -2165,7 +2165,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "ATTACHED_FILES_ON_FAIL" )
{
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val.c_str(), lval);
+ cmSystemTools::ExpandListArgument(val, lval);
for(std::vector<std::string>::iterator f = lval.begin();
f != lval.end(); ++f)
@@ -2176,7 +2176,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "RESOURCE_LOCK" )
{
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val.c_str(), lval);
+ cmSystemTools::ExpandListArgument(val, lval);
for(std::vector<std::string>::iterator f = lval.begin();
f != lval.end(); ++f)
@@ -2196,7 +2196,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "REQUIRED_FILES" )
{
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val.c_str(), lval);
+ cmSystemTools::ExpandListArgument(val, lval);
for(std::vector<std::string>::iterator f = lval.begin();
f != lval.end(); ++f)
@@ -2211,14 +2211,14 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "FAIL_REGULAR_EXPRESSION" )
{
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val.c_str(), lval);
+ cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
rtit->ErrorRegularExpressions.push_back(
std::pair<cmsys::RegularExpression, std::string>(
cmsys::RegularExpression(crit->c_str()),
- std::string(crit->c_str())));
+ std::string(*crit)));
}
}
if ( key == "PROCESSORS" )
@@ -2240,7 +2240,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "DEPENDS" )
{
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val.c_str(), lval);
+ cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
@@ -2250,7 +2250,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "ENVIRONMENT" )
{
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val.c_str(), lval);
+ cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
@@ -2260,7 +2260,7 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "LABELS" )
{
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val.c_str(), lval);
+ cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
@@ -2284,14 +2284,14 @@ bool cmCTestTestHandler::SetTestsProperties(
if ( key == "PASS_REGULAR_EXPRESSION" )
{
std::vector<std::string> lval;
- cmSystemTools::ExpandListArgument(val.c_str(), lval);
+ cmSystemTools::ExpandListArgument(val, lval);
std::vector<std::string>::iterator crit;
for ( crit = lval.begin(); crit != lval.end(); ++ crit )
{
rtit->RequiredRegularExpressions.push_back(
std::pair<cmsys::RegularExpression, std::string>(
cmsys::RegularExpression(crit->c_str()),
- std::string(crit->c_str())));
+ std::string(*crit)));
}
}
if ( key == "WORKING_DIRECTORY" )
@@ -2319,7 +2319,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
}
if ( this->MemCheck )
{
- std::vector<cmStdString>::iterator it;
+ std::vector<std::string>::iterator it;
bool found = false;
for ( it = this->CustomTestsIgnore.begin();
it != this->CustomTestsIgnore.end(); ++ it )
@@ -2339,7 +2339,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
}
else
{
- std::vector<cmStdString>::iterator it;
+ std::vector<std::string>::iterator it;
bool found = false;
for ( it = this->CustomTestsIgnore.begin();
it != this->CustomTestsIgnore.end(); ++ it )