| 13526 | } |
| 13527 | |
| 13528 | int Session::runInternal() { |
| 13529 | if( m_startupExceptions ) |
| 13530 | return 1; |
| 13531 | |
| 13532 | if (m_configData.showHelp || m_configData.libIdentify) { |
| 13533 | return 0; |
| 13534 | } |
| 13535 | |
| 13536 | CATCH_TRY { |
| 13537 | config(); // Force config to be constructed |
| 13538 | |
| 13539 | seedRng( *m_config ); |
| 13540 | |
| 13541 | if( m_configData.filenamesAsTags ) |
| 13542 | applyFilenamesAsTags( *m_config ); |
| 13543 | |
| 13544 | // Handle list request |
| 13545 | if( Option<std::size_t> listed = list( m_config ) ) |
| 13546 | return static_cast<int>( *listed ); |
| 13547 | |
| 13548 | TestGroup tests { m_config }; |
| 13549 | auto const totals = tests.execute(); |
| 13550 | |
| 13551 | if( m_config->warnAboutNoTests() && totals.error == -1 ) |
| 13552 | return 2; |
| 13553 | |
| 13554 | // Note that on unices only the lower 8 bits are usually used, clamping |
| 13555 | // the return value to 255 prevents false negative when some multiple |
| 13556 | // of 256 tests has failed |
| 13557 | return (std::min) (MaxExitCode, (std::max) (totals.error, static_cast<int>(totals.assertions.failed))); |
| 13558 | } |
| 13559 | #if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) |
| 13560 | catch( std::exception& ex ) { |
| 13561 | Catch::cerr() << ex.what() << std::endl; |
nothing calls this directly
no test coverage detected