2013-12-03 19:52:41 +01:00
|
|
|
/*
|
|
|
|
* Created by Phil on 03/12/2013.
|
|
|
|
* Copyright 2013 Two Blue Cubes Ltd. All rights reserved.
|
|
|
|
*
|
|
|
|
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
*/
|
|
|
|
#ifndef TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
|
|
|
|
#define TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
|
|
|
|
|
|
|
|
#include "catch_section_info.h"
|
|
|
|
#include "catch_totals.hpp"
|
|
|
|
#include "catch_timer.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace Catch {
|
|
|
|
|
2014-10-03 09:15:27 +02:00
|
|
|
class Section : NonCopyable {
|
2013-12-03 19:52:41 +01:00
|
|
|
public:
|
2014-07-09 08:39:57 +02:00
|
|
|
Section( SectionInfo const& info );
|
2013-12-03 19:52:41 +01:00
|
|
|
~Section();
|
|
|
|
|
|
|
|
// This indicates whether the section should be executed or not
|
2017-04-25 19:56:53 +02:00
|
|
|
explicit operator bool() const;
|
2013-12-03 19:52:41 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
SectionInfo m_info;
|
|
|
|
|
|
|
|
std::string m_name;
|
|
|
|
Counts m_assertions;
|
|
|
|
bool m_sectionIncluded;
|
|
|
|
Timer m_timer;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace Catch
|
|
|
|
|
|
|
|
#define INTERNAL_CATCH_SECTION( ... ) \
|
2014-07-09 08:39:57 +02:00
|
|
|
if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) )
|
2013-12-03 19:52:41 +01:00
|
|
|
|
|
|
|
#endif // TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
|