Add virtual std::string TestCaller::toString();

Signed-off-by: FrancisANDRE <zosrothko@orange.fr>
This commit is contained in:
FrancisANDRE 2015-12-18 12:16:06 +01:00
parent fb2b671f15
commit 0f9e561b9a
2 changed files with 10 additions and 2 deletions

View File

@ -62,6 +62,14 @@ public:
_fixture(new Fixture(name))
{
}
// Returns the name of the test case instance
virtual std::string toString()
{
const std::type_info& thisClass = typeid(*this);
return std::string(thisClass.name()) + "." + name();
}
protected:
void runTest()

View File

@ -95,7 +95,7 @@ public:
virtual TestResult* run();
virtual int countTestCases();
const std::string& name() const;
std::string toString();
virtual std::string toString();
virtual void setUp();
virtual void tearDown();
@ -167,7 +167,7 @@ protected:
const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME);
private:
protected:
const std::string _name;
};