Commit b4589f11faa8344b36e4ec871fb578bea7f1e48e

Authored by Jürgen Knödlseder
1 parent a712c382

Restore original test output format.

src/test/GTestSuite.cpp
@@ -264,14 +264,10 @@ bool GTestSuite::run(void) @@ -264,14 +264,10 @@ bool GTestSuite::run(void)
264 264
265 // Log name of test suite 265 // Log name of test suite
266 m_log << std::endl; 266 m_log << std::endl;
267 - //m_log.header3(this->name());  
268 267
269 // Initialise success flag 268 // Initialise success flag
270 bool success = true; 269 bool success = true;
271 270
272 - // Initialise test suite counter  
273 - int num_suites = 0;  
274 -  
275 // Loop over all functions in suite 271 // Loop over all functions in suite
276 for (m_index = 0; m_index < m_functions.size(); ++m_index) { 272 for (m_index = 0; m_index < m_functions.size(); ++m_index) {
277 273
@@ -284,12 +280,6 @@ bool GTestSuite::run(void) @@ -284,12 +280,6 @@ bool GTestSuite::run(void)
284 int old_errors = errors(); 280 int old_errors = errors();
285 int old_failures = failures(); 281 int old_failures = failures();
286 282
287 - // Insert newline after first test suite. That's just for  
288 - // cosmetics.  
289 - if (num_suites > 0) {  
290 - m_log << std::endl;  
291 - }  
292 -  
293 // Log the name of the test 283 // Log the name of the test
294 m_log << m_names[m_index] << ": "; 284 m_log << m_names[m_index] << ": ";
295 285
@@ -345,19 +335,16 @@ bool GTestSuite::run(void) @@ -345,19 +335,16 @@ bool GTestSuite::run(void)
345 335
346 // Log if there are errors or failures 336 // Log if there are errors or failures
347 if ((m_errors == old_errors && m_failures == old_failures)) { 337 if ((m_errors == old_errors && m_failures == old_failures)) {
348 - m_log << " ok"; 338 + m_log << " ok" << std::endl;
349 } 339 }
350 else { 340 else {
351 - m_log << " NOK"; 341 + m_log << " NOK" << std::endl;
352 success = false; 342 success = false;
353 } 343 }
354 344
355 // Add test case to test suite 345 // Add test case to test suite
356 m_tests.push_back(test); 346 m_tests.push_back(test);
357 347
358 - // Increment test suite counter  
359 - num_suites++;  
360 -  
361 } // endif: test case has a function pointer 348 } // endif: test case has a function pointer
362 349
363 } // endwhile: there were tests on the stack 350 } // endwhile: there were tests on the stack
src/test/GTestSuites.cpp
@@ -239,9 +239,14 @@ void GTestSuites::append(GTestSuite&amp; suite) @@ -239,9 +239,14 @@ void GTestSuites::append(GTestSuite&amp; suite)
239 ***************************************************************************/ 239 ***************************************************************************/
240 bool GTestSuites::run(void) 240 bool GTestSuites::run(void)
241 { 241 {
  242 + // Set header
  243 + std::string text = "* " + name() + " *";
  244 + std::string frame = fill("*", text.length());
  245 +
242 // Log name of test suites 246 // Log name of test suites
243 - m_log << std::endl;  
244 - m_log.header1(name()); 247 + m_log << std::endl << frame;
  248 + m_log << std::endl << text;
  249 + m_log << std::endl << frame;
245 250
246 // Initialise success flag 251 // Initialise success flag
247 bool success = true; 252 bool success = true;