mirror of
https://github.com/catchorg/Catch2.git
synced 2025-06-04 19:08:12 +00:00
Separated getting test cases to run from running them
This commit is contained in:
parent
d0a5461add
commit
c1dbc9c22b
9 changed files with 92 additions and 80 deletions
|
@ -114,17 +114,13 @@ namespace Catch {
|
|||
public:
|
||||
EmbeddedRunner() : m_reporter( new MockReporter() ) {}
|
||||
|
||||
std::size_t runMatching( const std::string& rawTestSpec,
|
||||
const std::string& reporter = "basic" );
|
||||
Totals runMatching( const std::string& rawTestSpec,
|
||||
const std::string& reporter = "basic" );
|
||||
|
||||
std::string getOutput() {
|
||||
return m_output;
|
||||
}
|
||||
|
||||
const Totals& getTotals() const {
|
||||
return m_totals;
|
||||
}
|
||||
|
||||
void addRecorder( const std::string& recorder ) {
|
||||
m_reporter->addRecorder( recorder );
|
||||
}
|
||||
|
@ -134,7 +130,6 @@ namespace Catch {
|
|||
}
|
||||
|
||||
private:
|
||||
Totals m_totals;
|
||||
std::string m_output;
|
||||
Ptr<MockReporter> m_reporter;
|
||||
};
|
||||
|
@ -157,8 +152,7 @@ namespace Catch {
|
|||
|
||||
void operator()( const TestCaseInfo& testCase ) {
|
||||
EmbeddedRunner runner;
|
||||
runner.runMatching( testCase.getName() );
|
||||
Totals totals = runner.getTotals();
|
||||
Totals totals = runner.runMatching( testCase.getName() );
|
||||
switch( m_expectedResult ) {
|
||||
case Expected::ToSucceed:
|
||||
if( totals.assertions.failed > 0 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue