MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / sectionStarting

Method sectionStarting

unittests/catch.hpp:3895–3918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3893 void testCaseStarting( TestCaseInfo const& ) override {}
3894
3895 void sectionStarting( SectionInfo const& sectionInfo ) override {
3896 SectionStats incompleteStats( sectionInfo, Counts(), 0, false );
3897 std::shared_ptr<SectionNode> node;
3898 if( m_sectionStack.empty() ) {
3899 if( !m_rootSection )
3900 m_rootSection = std::make_shared<SectionNode>( incompleteStats );
3901 node = m_rootSection;
3902 }
3903 else {
3904 SectionNode& parentNode = *m_sectionStack.back();
3905 auto it =
3906 std::find_if( parentNode.childSections.begin(),
3907 parentNode.childSections.end(),
3908 BySectionInfo( sectionInfo ) );
3909 if( it == parentNode.childSections.end() ) {
3910 node = std::make_shared<SectionNode>( incompleteStats );
3911 parentNode.childSections.push_back( node );
3912 }
3913 else
3914 node = *it;
3915 }
3916 m_sectionStack.push_back( node );
3917 m_deepestSection = std::move(node);
3918 }
3919
3920 void assertionStarting(AssertionInfo const&) override {}
3921

Callers

nothing calls this directly

Calls 6

CountsClass · 0.85
BySectionInfoClass · 0.85
backMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected