mirror of
https://github.com/catchorg/Catch2.git
synced 2025-01-16 15:18:00 +00:00
Compare commits
8 Commits
d090074da7
...
8b0845b1a2
Author | SHA1 | Date | |
---|---|---|---|
|
8b0845b1a2 | ||
|
c5037743e6 | ||
|
9d6ac62aff | ||
|
ed0ea30149 | ||
|
35098a62d8 | ||
|
ba57c17310 | ||
|
4e0af77e29 | ||
|
eaf7113fd3 |
@ -5,14 +5,10 @@
|
||||
// 2. My listener and registration
|
||||
// 3. Test cases
|
||||
|
||||
// main() provided in 000-CatchMain.cpp
|
||||
|
||||
// Let Catch provide the required interfaces:
|
||||
#define CATCH_CONFIG_EXTERNAL_INTERFACES
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/reporters/catch_reporter_bases.hpp>
|
||||
#include <catch2/catch_reporter_registrars.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
#include <iostream>
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
@ -11,17 +11,15 @@
|
||||
#ifndef TWOBLUECUBES_CATCH_DETAIL_ANALYSIS_HPP_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_DETAIL_ANALYSIS_HPP_INCLUDED
|
||||
|
||||
#include <catch2/benchmark/catch_clock.hpp>
|
||||
#include <catch2/benchmark/catch_estimate.hpp>
|
||||
#include <catch2/benchmark/catch_outlier_classification.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <numeric>
|
||||
#include <tuple>
|
||||
#include <cmath>
|
||||
#include <utility>
|
||||
#include <cstddef>
|
||||
|
||||
namespace Catch {
|
||||
namespace Benchmark {
|
||||
@ -64,7 +62,8 @@ namespace Catch {
|
||||
template <typename Estimator, typename Iterator>
|
||||
sample jackknife(Estimator&& estimator, Iterator first, Iterator last) {
|
||||
auto n = last - first;
|
||||
auto second = std::next(first);
|
||||
auto second = first;
|
||||
++second;
|
||||
sample results;
|
||||
results.reserve(n);
|
||||
|
||||
|
@ -11,6 +11,8 @@
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/internal/catch_test_spec_parser.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_tag_alias_registry.hpp>
|
||||
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <catch2/internal/catch_startup_exception_registry.hpp>
|
||||
#include <catch2/internal/catch_singletons.hpp>
|
||||
#include <catch2/internal/catch_enum_values_registry.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -18,14 +18,11 @@
|
||||
#include <catch2/internal/catch_random_number_generator.hpp>
|
||||
#include <catch2/internal/catch_startup_exception_registry.hpp>
|
||||
#include <catch2/internal/catch_text.hpp>
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
#include <catch2/internal/catch_windows_h_proxy.hpp>
|
||||
#include <catch2/reporters/catch_reporter_listening.hpp>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iomanip>
|
||||
#include <set>
|
||||
#include <iterator>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include <catch2/internal/catch_commandline.hpp>
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/internal/catch_text.hpp>
|
||||
#include <catch2/internal/catch_unique_ptr.hpp>
|
||||
|
||||
namespace Catch {
|
||||
|
@ -12,10 +12,9 @@
|
||||
#include <catch2/interfaces/catch_interfaces_testcase.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <cctype>
|
||||
#include <exception>
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include <catch2/catch_test_spec.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <catch2/internal/catch_list.hpp>
|
||||
#include <catch2/internal/catch_text.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
|
@ -10,9 +10,7 @@
|
||||
|
||||
#include <catch2/catch_section_info.hpp>
|
||||
#include <catch2/internal/catch_common.hpp>
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/catch_totals.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
#include <catch2/catch_assertion_result.hpp>
|
||||
#include <catch2/internal/catch_message_info.hpp>
|
||||
#include <catch2/internal/catch_option.hpp>
|
||||
@ -24,6 +22,7 @@
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iosfwd>
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
@ -32,6 +31,10 @@ namespace Catch {
|
||||
|
||||
struct ReporterDescription;
|
||||
struct TagInfo;
|
||||
struct TestCaseInfo;
|
||||
class TestCaseHandle;
|
||||
struct IConfig;
|
||||
class Config;
|
||||
|
||||
struct ReporterConfig {
|
||||
explicit ReporterConfig( IConfig const* _fullConfig );
|
||||
|
@ -7,8 +7,6 @@
|
||||
*/
|
||||
|
||||
#include <catch2/internal/catch_assertion_handler.hpp>
|
||||
#include <catch2/catch_assertion_result.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_runner.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/internal/catch_context.hpp>
|
||||
#include <catch2/internal/catch_enforce.hpp>
|
||||
|
@ -9,6 +9,9 @@
|
||||
#ifndef TWOBLUECUBES_CATCH_CLARA_H_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_CLARA_H_INCLUDED
|
||||
|
||||
// For CATCH_CONFIG_CONSOLE_WIDTH. We should refactor this out somewhere else.
|
||||
#include <catch2/catch_config.hpp>
|
||||
|
||||
// Use Catch's value for console width (store Clara's off to the side, if present)
|
||||
#ifdef CLARA_CONFIG_CONSOLE_WIDTH
|
||||
#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
|
||||
|
@ -8,11 +8,12 @@
|
||||
|
||||
#include <catch2/internal/catch_commandline.hpp>
|
||||
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <ctime>
|
||||
|
||||
|
@ -8,11 +8,12 @@
|
||||
#ifndef TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
|
||||
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/internal/catch_clara.hpp>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct ConfigData;
|
||||
|
||||
clara::Parser makeCommandLineParser( ConfigData& config );
|
||||
|
||||
} // end namespace Catch
|
||||
|
@ -7,8 +7,6 @@
|
||||
*/
|
||||
|
||||
#include <catch2/internal/catch_common.hpp>
|
||||
#include <catch2/internal/catch_context.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
|
||||
#include <cstring>
|
||||
#include <ostream>
|
||||
|
@ -20,8 +20,6 @@
|
||||
#endif
|
||||
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
|
||||
// We need a dummy global operator<< so we can bring it into Catch namespace later
|
||||
struct Catch_global_namespace_dummy {};
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <catch2/internal/catch_debugger.hpp>
|
||||
#include <catch2/internal/catch_windows_h_proxy.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <ostream>
|
||||
|
||||
namespace Catch {
|
||||
namespace {
|
||||
|
@ -13,7 +13,6 @@ namespace Catch {
|
||||
struct IResultCapture;
|
||||
struct IRunner;
|
||||
struct IConfig;
|
||||
struct IMutableContext;
|
||||
|
||||
struct IContext
|
||||
{
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
|
||||
#include <map>
|
||||
#include <cassert>
|
||||
|
||||
namespace Catch {
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_enum_values_registry.hpp>
|
||||
#include <catch2/internal/catch_unique_ptr.hpp>
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
@ -13,16 +13,11 @@
|
||||
#include <catch2/interfaces/catch_interfaces_testcase.hpp>
|
||||
|
||||
#include <catch2/internal/catch_context.hpp>
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
|
||||
#include <catch2/internal/catch_console_colour.hpp>
|
||||
#include <catch2/internal/catch_test_spec_parser.hpp>
|
||||
#include <catch2/catch_tostring.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
|
||||
#include <limits>
|
||||
#include <algorithm>
|
||||
#include <set>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
namespace Catch {
|
||||
namespace {
|
||||
|
@ -8,7 +8,6 @@
|
||||
#ifndef TWOBLUECUBES_CATCH_LIST_H_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_LIST_H_INCLUDED
|
||||
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
|
||||
#include <set>
|
||||
@ -18,6 +17,8 @@
|
||||
namespace Catch {
|
||||
|
||||
struct IStreamingReporter;
|
||||
class Config;
|
||||
|
||||
|
||||
struct ReporterDescription {
|
||||
std::string name, description;
|
||||
|
@ -6,9 +6,6 @@
|
||||
*/
|
||||
|
||||
#include <catch2/internal/catch_random_number_generator.hpp>
|
||||
#include <catch2/internal/catch_context.hpp>
|
||||
#include <catch2/internal/catch_run_context.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <catch2/interfaces/catch_interfaces_generatortracker.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/internal/catch_run_context.hpp>
|
||||
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
||||
#include <catch2/internal/catch_context.hpp>
|
||||
@ -7,6 +9,7 @@
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
#include <catch2/catch_timer.hpp>
|
||||
#include <catch2/internal/catch_output_redirect.hpp>
|
||||
#include <catch2/internal/catch_assertion_handler.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <algorithm>
|
||||
|
@ -8,25 +8,23 @@
|
||||
#ifndef TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
|
||||
#define TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_generatortracker.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_runner.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_exception.hpp>
|
||||
#include <catch2/catch_config.hpp>
|
||||
#include <catch2/internal/catch_test_registry.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
#include <catch2/internal/catch_test_macro_impl.hpp>
|
||||
#include <catch2/catch_message.hpp>
|
||||
#include <catch2/catch_totals.hpp>
|
||||
#include <catch2/catch_test_spec.hpp>
|
||||
#include <catch2/internal/catch_test_case_tracker.hpp>
|
||||
#include <catch2/internal/catch_assertion_handler.hpp>
|
||||
#include <catch2/catch_assertion_info.hpp>
|
||||
#include <catch2/catch_assertion_result.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct IMutableContext;
|
||||
struct IGeneratorTracker;
|
||||
struct IConfig;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -10,12 +10,14 @@
|
||||
#include <catch2/internal/catch_test_macro_impl.hpp>
|
||||
#include <catch2/internal/catch_uncaught_exceptions.hpp>
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
Section::Section( SectionInfo const& info )
|
||||
: m_info( info ),
|
||||
m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
|
||||
{
|
||||
Section::Section( SectionInfo&& info ):
|
||||
m_info( std::move( info ) ),
|
||||
m_sectionIncluded(
|
||||
getResultCapture().sectionStarted( m_info, m_assertions ) ) {
|
||||
// Non-"included" sections will not use the timing information
|
||||
// anyway, so don't bother with the potential syscall.
|
||||
if (m_sectionIncluded) {
|
||||
|
@ -19,7 +19,7 @@ namespace Catch {
|
||||
|
||||
class Section : NonCopyable {
|
||||
public:
|
||||
Section( SectionInfo const& info );
|
||||
Section( SectionInfo&& info );
|
||||
~Section();
|
||||
|
||||
// This indicates whether the section should be executed or not
|
||||
@ -28,7 +28,6 @@ namespace Catch {
|
||||
private:
|
||||
SectionInfo m_info;
|
||||
|
||||
std::string m_name;
|
||||
Counts m_assertions;
|
||||
bool m_sectionIncluded;
|
||||
Timer m_timer;
|
||||
|
@ -12,8 +12,6 @@
|
||||
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
TagAliasRegistry::~TagAliasRegistry() {}
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <catch2/catch_tag_alias.hpp>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -17,9 +17,7 @@
|
||||
#include <catch2/catch_test_spec.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <random>
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -12,8 +12,6 @@
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <catch2/internal/catch_test_spec_parser.hpp>
|
||||
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_tag_alias_registry.hpp>
|
||||
|
||||
|
||||
namespace Catch {
|
||||
|
@ -14,10 +14,14 @@
|
||||
#endif
|
||||
|
||||
#include <catch2/catch_test_spec.hpp>
|
||||
#include <catch2/interfaces/catch_interfaces_tag_alias_registry.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
struct ITagAliasRegistry;
|
||||
|
||||
class TestSpecParser {
|
||||
enum Mode{ None, Name, QuotedName, Tag, EscapedName };
|
||||
Mode m_mode = None;
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <type_traits>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include <catch2/reporters/catch_reporter_automake.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <ostream>
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
#include <catch2/catch_config.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <cfloat>
|
||||
#include <cstdio>
|
||||
|
@ -10,13 +10,10 @@
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <cfloat>
|
||||
#include <cstdio>
|
||||
#include <cassert>
|
||||
#include <memory>
|
||||
#include <iosfwd>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Catch {
|
||||
// Returns double formatted as %.3f (format expected on output)
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <catch2/reporters/catch_reporter_compact.hpp>
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/internal/catch_compiler_capabilities.hpp>
|
||||
#include <catch2/internal/catch_console_colour.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <catch2/internal/catch_text.hpp>
|
||||
#include <catch2/internal/catch_stream.hpp>
|
||||
#include <catch2/internal/catch_stringref.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <cfloat>
|
||||
#include <cstdio>
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/catch_reporter_registrars.hpp>
|
||||
#include <catch2/internal/catch_text.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <ctime>
|
||||
|
@ -6,7 +6,8 @@
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#include <catch2/reporters/catch_reporter_listening.hpp>
|
||||
#include <catch2/reporters/catch_reporter_listening.hpp>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace Catch {
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <catch2/reporters/catch_reporter_sonarqube.hpp>
|
||||
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <map>
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <catch2/reporters/catch_reporter_tap.hpp>
|
||||
#include <catch2/internal/catch_console_colour.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <ostream>
|
||||
|
@ -8,6 +8,9 @@
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/internal/catch_enforce.hpp>
|
||||
#include <catch2/internal/catch_text.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace Catch {
|
||||
|
||||
|
@ -8,8 +8,11 @@
|
||||
|
||||
#include <catch2/reporters/catch_reporter_xml.hpp>
|
||||
|
||||
#include <catch2/interfaces/catch_interfaces_config.hpp>
|
||||
#include <catch2/catch_test_spec.hpp>
|
||||
#include <catch2/internal/catch_string_manip.hpp>
|
||||
#include <catch2/internal/catch_list.hpp>
|
||||
#include <catch2/catch_test_case_info.hpp>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
|
Loading…
Reference in New Issue
Block a user