Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_section.cpp
Go to the documentation of this file.
1/*
2 * Created by Phil on 03/11/2010.
3 * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
4 *
5 * Distributed under the Boost Software License, Version 1.0. (See accompanying
6 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 */
8
9#include "catch_section.h"
10#include "catch_capture.hpp"
12
13namespace Catch {
14
16 : m_info( info ),
17 m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
18 {
19 m_timer.start();
20 }
21
23 if( m_sectionIncluded ) {
24 SectionEndInfo endInfo{ m_info, m_assertions, m_timer.getElapsedSeconds() };
27 else
28 getResultCapture().sectionEnded( endInfo );
29 }
30 }
31
32 // This indicates whether the section should be executed or not
33 Section::operator bool() const {
34 return m_sectionIncluded;
35 }
36
37
38} // end namespace Catch
Section(SectionInfo const &info)
auto getElapsedSeconds() const -> double
IResultCapture & getResultCapture()
virtual void sectionEnded(SectionEndInfo const &endInfo)=0
virtual void sectionEndedEarly(SectionEndInfo const &endInfo)=0