| 405 | }; |
| 406 | |
| 407 | VerifyApplication::TestReturnValue VerifyApplication::Test::execute(VerifyApplication* state, bool silent) |
| 408 | { |
| 409 | if (!isEnabled()) |
| 410 | return SKIPPED; |
| 411 | |
| 412 | if (!silent) |
| 413 | std::cout << std::setw(TEXT_ALIGN) << name << " ..." << std::flush; |
| 414 | |
| 415 | TestReturnValue v = SKIPPED; |
| 416 | try { |
| 417 | v = run(state,silent); |
| 418 | } catch (...) { |
| 419 | v = FAILED; |
| 420 | } |
| 421 | TestReturnValue ev = ty != TEST_SHOULD_FAIL ? PASSED : FAILED; |
| 422 | bool passed = v == ev || v == SKIPPED; |
| 423 | |
| 424 | if (silent) |
| 425 | { |
| 426 | Lock<MutexSys> lock(state->mutex); |
| 427 | if (v != SKIPPED) { |
| 428 | if (passed ) std::cout << state->green ("+") << std::flush; |
| 429 | else if (ignoreFailure) std::cout << state->yellow("!") << std::flush; |
| 430 | else std::cout << state->red ("-") << std::flush; |
| 431 | } |
| 432 | } |
| 433 | else |
| 434 | { |
| 435 | if (v == SKIPPED ) std::cout << state->green (" [SKIPPED]") << std::endl << std::flush; |
| 436 | else if (passed ) std::cout << state->green (" [PASSED]" ) << std::endl << std::flush; |
| 437 | else if (ignoreFailure) std::cout << state->yellow(" [FAILED] (ignored)") << std::endl << std::flush; |
| 438 | else std::cout << state->red (" [FAILED]" ) << std::endl << std::flush; |
| 439 | } |
| 440 | |
| 441 | /* update passed/failed counters */ |
| 442 | state->numPassedTests += passed; |
| 443 | if (ignoreFailure) state->numFailedAndIgnoredTests += !passed; |
| 444 | else state->numFailedTests += !passed; |
| 445 | |
| 446 | /* do ignore failures for some specific tests */ |
| 447 | if (ignoreFailure) |
| 448 | passed = true; |
| 449 | //assert(passed); |
| 450 | return passed ? PASSED : FAILED; |
| 451 | } |
| 452 | |
| 453 | double VerifyApplication::Benchmark::readDatabase(VerifyApplication* state) |
| 454 | { |
no test coverage detected