stringapi: Use strings for test names
This commit is contained in:
parent
b26c70cc9a
commit
83a5e453f8
@ -2126,7 +2126,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
|
|||||||
if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
|
if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
this->AddCTestConfigurationOverwrite(args[i].c_str());
|
this->AddCTestConfigurationOverwrite(args[i]);
|
||||||
}
|
}
|
||||||
if(this->CheckArgument(arg, "-A", "--add-notes") && i < args.size() - 1)
|
if(this->CheckArgument(arg, "-A", "--add-notes") && i < args.size() - 1)
|
||||||
{
|
{
|
||||||
@ -2840,9 +2840,8 @@ void cmCTest::AddSubmitFile(Part part, const char* name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void cmCTest::AddCTestConfigurationOverwrite(const char* encstr)
|
void cmCTest::AddCTestConfigurationOverwrite(const std::string& overStr)
|
||||||
{
|
{
|
||||||
std::string overStr = encstr;
|
|
||||||
size_t epos = overStr.find("=");
|
size_t epos = overStr.find("=");
|
||||||
if ( epos == overStr.npos )
|
if ( epos == overStr.npos )
|
||||||
{
|
{
|
||||||
|
@ -70,8 +70,8 @@ public:
|
|||||||
{
|
{
|
||||||
PartInfo(): Enabled(false) {}
|
PartInfo(): Enabled(false) {}
|
||||||
|
|
||||||
void SetName(const char* name) { this->Name = name; }
|
void SetName(const std::string& name) { this->Name = name; }
|
||||||
const char* GetName() const { return this->Name.c_str(); }
|
const std::string& GetName() const { return this->Name; }
|
||||||
|
|
||||||
void Enable() { this->Enabled = true; }
|
void Enable() { this->Enabled = true; }
|
||||||
operator bool() const { return this->Enabled; }
|
operator bool() const { return this->Enabled; }
|
||||||
@ -349,7 +349,7 @@ public:
|
|||||||
|
|
||||||
//! Add overwrite to ctest configuration.
|
//! Add overwrite to ctest configuration.
|
||||||
// The format is key=value
|
// The format is key=value
|
||||||
void AddCTestConfigurationOverwrite(const char* 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 std::vector<cmStdString> &files);
|
int GenerateNotesFile(const std::vector<cmStdString> &files);
|
||||||
|
@ -3852,34 +3852,27 @@ cmTarget* cmMakefile::FindTarget(const std::string& name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmTest* cmMakefile::CreateTest(const char* testName)
|
cmTest* cmMakefile::CreateTest(const std::string& testName)
|
||||||
{
|
{
|
||||||
if ( !testName )
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cmTest* test = this->GetTest(testName);
|
cmTest* test = this->GetTest(testName);
|
||||||
if ( test )
|
if ( test )
|
||||||
{
|
{
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
test = new cmTest(this);
|
test = new cmTest(this);
|
||||||
test->SetName(testName);
|
test->SetName(testName.c_str());
|
||||||
this->Tests[testName] = test;
|
this->Tests[testName] = test;
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmTest* cmMakefile::GetTest(const char* testName) const
|
cmTest* cmMakefile::GetTest(const std::string& testName) const
|
||||||
{
|
{
|
||||||
if(testName)
|
std::map<cmStdString, cmTest*>::const_iterator
|
||||||
|
mi = this->Tests.find(testName);
|
||||||
|
if(mi != this->Tests.end())
|
||||||
{
|
{
|
||||||
std::map<cmStdString, cmTest*>::const_iterator
|
return mi->second;
|
||||||
mi = this->Tests.find(testName);
|
|
||||||
if(mi != this->Tests.end())
|
|
||||||
{
|
|
||||||
return mi->second;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -782,12 +782,12 @@ public:
|
|||||||
void AddMacro(const char* name, const char* signature);
|
void AddMacro(const char* name, const char* signature);
|
||||||
|
|
||||||
///! Add a new cmTest to the list of tests for this makefile.
|
///! Add a new cmTest to the list of tests for this makefile.
|
||||||
cmTest* CreateTest(const char* testName);
|
cmTest* CreateTest(const std::string& testName);
|
||||||
|
|
||||||
/** Get a cmTest pointer for a given test name, if the name is
|
/** Get a cmTest pointer for a given test name, if the name is
|
||||||
* not found, then a null pointer is returned.
|
* not found, then a null pointer is returned.
|
||||||
*/
|
*/
|
||||||
cmTest* GetTest(const char* testName) const;
|
cmTest* GetTest(const std::string& testName) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of macros as a ; separated string
|
* Get a list of macros as a ; separated string
|
||||||
|
@ -91,7 +91,7 @@ bool cmSetTestsPropertiesCommand
|
|||||||
|
|
||||||
|
|
||||||
bool cmSetTestsPropertiesCommand
|
bool cmSetTestsPropertiesCommand
|
||||||
::SetOneTest(const char *tname,
|
::SetOneTest(const std::string& tname,
|
||||||
std::vector<std::string> &propertyPairs,
|
std::vector<std::string> &propertyPairs,
|
||||||
cmMakefile *mf, std::string &errors)
|
cmMakefile *mf, std::string &errors)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand);
|
cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand);
|
||||||
|
|
||||||
static bool SetOneTest(const char *tname,
|
static bool SetOneTest(const std::string& tname,
|
||||||
std::vector<std::string> &propertyPairs,
|
std::vector<std::string> &propertyPairs,
|
||||||
cmMakefile *mf,
|
cmMakefile *mf,
|
||||||
std::string &errors);
|
std::string &errors);
|
||||||
|
@ -38,12 +38,8 @@ cmListFileBacktrace const& cmTest::GetBacktrace() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTest::SetName(const char* name)
|
void cmTest::SetName(const std::string& name)
|
||||||
{
|
{
|
||||||
if ( !name )
|
|
||||||
{
|
|
||||||
name = "";
|
|
||||||
}
|
|
||||||
this->Name = name;
|
this->Name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ public:
|
|||||||
~cmTest();
|
~cmTest();
|
||||||
|
|
||||||
///! Set the test name
|
///! Set the test name
|
||||||
void SetName(const char* name);
|
void SetName(const std::string& name);
|
||||||
const char* GetName() const { return this->Name.c_str(); }
|
std::string GetName() const { return this->Name; }
|
||||||
|
|
||||||
void SetCommand(std::vector<std::string> const& command);
|
void SetCommand(std::vector<std::string> const& command);
|
||||||
std::vector<std::string> const& GetCommand() const
|
std::vector<std::string> const& GetCommand() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user