mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Outline throwing of TestSkipException
This commit is contained in:
parent
ba94278bdd
commit
1dfaa8abe7
@ -51,11 +51,7 @@ namespace Catch {
|
||||
throw_test_failure_exception();
|
||||
}
|
||||
if ( m_reaction.shouldSkip ) {
|
||||
#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS )
|
||||
throw Catch::TestSkipException();
|
||||
#else
|
||||
CATCH_ERROR( "Explicitly skipping tests during runtime requires exceptions" );
|
||||
#endif
|
||||
throw_test_skip_exception();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,4 +20,12 @@ namespace Catch {
|
||||
#endif
|
||||
}
|
||||
|
||||
void throw_test_skip_exception() {
|
||||
#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS )
|
||||
throw Catch::TestSkipException();
|
||||
#else
|
||||
CATCH_ERROR( "Explicitly skipping tests during runtime requires exceptions" );
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Catch
|
||||
|
@ -12,6 +12,8 @@ namespace Catch {
|
||||
|
||||
//! Used to signal that an assertion macro failed
|
||||
struct TestFailureException{};
|
||||
//! Used to signal that the remainder of a test should be skipped
|
||||
struct TestSkipException {};
|
||||
|
||||
/**
|
||||
* Outlines throwing of `TestFailureException` into a single TU
|
||||
@ -20,8 +22,12 @@ namespace Catch {
|
||||
*/
|
||||
[[noreturn]] void throw_test_failure_exception();
|
||||
|
||||
//! Used to signal that the remainder of a test should be skipped
|
||||
struct TestSkipException{};
|
||||
/**
|
||||
* Outlines throwing of `TestSkipException` into a single TU
|
||||
*
|
||||
* Also handles `CATCH_CONFIG_DISABLE_EXCEPTIONS` for callers.
|
||||
*/
|
||||
[[noreturn]] void throw_test_skip_exception();
|
||||
|
||||
} // namespace Catch
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user