62 std::string logInformation;
63 if ( (prefix + _testCaseName).length()>0 ) {
64 logInformation =
"running test case collection \"" + prefix + _testCaseName +
"\" ...";
67 logInformation =
"running test case collection ...";
75 logInformation +=
"... WARNING: no tests defined ... ";
77 logInformation += std::to_string(x);
81 std::string fullQualifiedName = _testCaseName.length()>0 ? prefix +_testCaseName +
"." : prefix;
82 for (std::map<std::string, TreeTestCaseCollection*>::iterator p = _subTests.begin(); p!=_subTests.end(); p++ ) {
83 (*p).second->run( fullQualifiedName );
84 _errors += (*p).second->getNumberOfErrors();
87 for (std::list<tarch::tests::TestCase*>::iterator p = _testCases.begin(); p!=_testCases.end(); p++ ) {
89 logInformation +=
".";
90 currentTestCase->
run();
92 if (additionalErrors>0) {
93 logInformation +=
"x";
97 logInformation +=
".";
101 if ( _errors==0 and _testCases.empty() and _subTests.empty() ) {
102 logInformation +=
" pass (no local tests)";
104 else if ( _errors==0 and _testCases.empty() ) {
105 logInformation +=
" pass (no local tests, subtests all successful)";
107 else if (_errors==0 and _testCases.size()==1) {
108 logInformation +=
" ok (1 test)";
110 else if (_errors==0) {
111 logInformation +=
" ok (" + std::to_string(_testCases.size()) +
" tests)";
114 logInformation +=
" failed";
117 if ( _writeToLog and _testCaseName!=
"" ) {
118 logInfo(
"run()",logInformation );
129 if ( isNameWithoutHierarchy(fullQualifiedPath) ) {
130 _testCases.push_back(testCase);
133 std::string firstPartOfIdentifier = getFirstIdentifierInHierarchy( fullQualifiedPath );
134 std::string secondPartOfIdentifier = getRemainingPathWithoutIdentifier( fullQualifiedPath );
135 if (_subTests.find(firstPartOfIdentifier) == _subTests.end() ) {
137 std::pair<std::string,TreeTestCaseCollection*>(
138 firstPartOfIdentifier,
143 _subTests[firstPartOfIdentifier]->addTestCase(secondPartOfIdentifier, testCase);