From 6020f8f27cf6d0c1c1ead6ee93f0c5b067e9f2c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Tue, 5 May 2020 21:07:16 +0200 Subject: [PATCH] Add convenience headers that include all headers in a subpart The naming scheme is simple, to include all matchers, include header `catch2/matchers/catch_matchers_all.hpp`. To include **everything**, include `catch2/catch_all.hpp`. --- src/CMakeLists.txt | 6 ++ src/catch2/benchmark/catch_benchmark_all.hpp | 37 ++++++++ src/catch2/catch_all.hpp | 92 +++++++++++++++++++ .../generators/catch_generators_all.hpp | 23 +++++ .../interfaces/catch_interfaces_all.hpp | 29 ++++++ src/catch2/matchers/catch_matchers_all.hpp | 27 ++++++ src/catch2/reporters/catch_reporters_all.hpp | 28 ++++++ 7 files changed, 242 insertions(+) create mode 100644 src/catch2/benchmark/catch_benchmark_all.hpp create mode 100644 src/catch2/catch_all.hpp create mode 100644 src/catch2/generators/catch_generators_all.hpp create mode 100644 src/catch2/interfaces/catch_interfaces_all.hpp create mode 100644 src/catch2/matchers/catch_matchers_all.hpp create mode 100644 src/catch2/reporters/catch_reporters_all.hpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4b1c81d0..443f62b5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,6 +3,7 @@ include(MiscFunctions) # Please keep these ordered alphabetically set(BENCHMARK_HEADERS ${SOURCES_DIR}/benchmark/catch_benchmark.hpp + ${SOURCES_DIR}/benchmark/catch_benchmark_all.hpp ${SOURCES_DIR}/benchmark/catch_chronometer.hpp ${SOURCES_DIR}/benchmark/catch_clock.hpp ${SOURCES_DIR}/benchmark/catch_constructor.hpp @@ -33,6 +34,10 @@ set(BENCHMARK_SOURCES SOURCE_GROUP("benchmark" FILES ${BENCHMARK_HEADERS} ${BENCHMARK_SOURCES}) set(INTERNAL_HEADERS + ${SOURCES_DIR}/catch_all.hpp + ${SOURCES_DIR}/matchers/catch_matchers_all.hpp + ${SOURCES_DIR}/generators/catch_generators_all.hpp + ${SOURCES_DIR}/interfaces/catch_interfaces_all.hpp ${SOURCES_DIR}/matchers/internal/catch_matchers_impl.hpp ${SOURCES_DIR}/internal/catch_container_nonmembers.hpp ${SOURCES_DIR}/catch_approx.hpp @@ -198,6 +203,7 @@ CheckFileList(INTERNAL_FILES ${SOURCES_DIR}/internal) # Please keep these ordered alphabetically set(REPORTER_HEADERS + ${SOURCES_DIR}/reporters/catch_reporters_all.hpp ${SOURCES_DIR}/reporters/catch_reporter_automake.hpp ${SOURCES_DIR}/reporters/catch_reporter_bases.hpp ${SOURCES_DIR}/reporters/catch_reporter_compact.hpp diff --git a/src/catch2/benchmark/catch_benchmark_all.hpp b/src/catch2/benchmark/catch_benchmark_all.hpp new file mode 100644 index 00000000..0210bd2e --- /dev/null +++ b/src/catch2/benchmark/catch_benchmark_all.hpp @@ -0,0 +1,37 @@ +/** \file + * This is a convenience header for Catch2's benchmarking. It includes + * **all** of Catch2 headers related to benchmarking. + * + * Generally the Catch2 users should use specific includes they need, + * but this header can be used instead for ease-of-experimentation, or + * just plain convenience, at the cost of (significantly) increased + * compilation times. + * + * When a new header is added to either the `benchmark` folder, or to + * the corresponding internal (detail) subfolder, it should be added here. + */ + +#ifndef CATCH_BENCHMARK_ALL_HPP_INCLUDED +#define CATCH_BENCHMARK_ALL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // CATCH_BENCHMARK_ALL_HPP_INCLUDED diff --git a/src/catch2/catch_all.hpp b/src/catch2/catch_all.hpp new file mode 100644 index 00000000..e7d3bfd9 --- /dev/null +++ b/src/catch2/catch_all.hpp @@ -0,0 +1,92 @@ +/** \file + * This is a convenience header for Catch2. It includes **all** of Catch2 headers. + * + * Generally the Catch2 users should use specific includes they need, + * but this header can be used instead for ease-of-experimentation, or + * just plain convenience, at the cost of (significantly) increased + * compilation times. + * + * When a new header is added to either the top level folder, or to the + * corresponding internal subfolder, it should be added here. Headers + * added to the various subparts (e.g. matchers, generators, etc...), + * should go their respective catch-all headers. + */ + +#ifndef CATCH_ALL_HPP_INCLUDED +#define CATCH_ALL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // CATCH_ALL_HPP_INCLUDED diff --git a/src/catch2/generators/catch_generators_all.hpp b/src/catch2/generators/catch_generators_all.hpp new file mode 100644 index 00000000..f8e7459d --- /dev/null +++ b/src/catch2/generators/catch_generators_all.hpp @@ -0,0 +1,23 @@ +/** \file + * This is a convenience header for Catch2's Generator support. It includes + * **all** of Catch2 headers related to generators. + * + * Generally the Catch2 users should use specific includes they need, + * but this header can be used instead for ease-of-experimentation, or + * just plain convenience, at the cost of (significantly) increased + * compilation times. + * + * When a new header is added to either the `generators` folder, + * or to the corresponding internal subfolder, it should be added here. + */ + +#ifndef CATCH_GENERATORS_ALL_HPP_INCLUDED +#define CATCH_GENERATORS_ALL_HPP_INCLUDED + +#include +#include +#include +#include +#include + +#endif // CATCH_GENERATORS_ALL_HPP_INCLUDED diff --git a/src/catch2/interfaces/catch_interfaces_all.hpp b/src/catch2/interfaces/catch_interfaces_all.hpp new file mode 100644 index 00000000..c70ed3ed --- /dev/null +++ b/src/catch2/interfaces/catch_interfaces_all.hpp @@ -0,0 +1,29 @@ +/** \file + * This is a convenience header for Catch2's interfaces. It includes + * **all** of Catch2 headers related to interfaces. + * + * Generally the Catch2 users should use specific includes they need, + * but this header can be used instead for ease-of-experimentation, or + * just plain convenience, at the cost of somewhat increased compilation + * times. + * + * When a new header is added to either the `interfaces` folder, or to + * the corresponding internal subfolder, it should be added here. + */ + + +#ifndef CATCH_INTERFACES_ALL_HPP_INCLUDED +#define CATCH_INTERFACES_ALL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // CATCH_INTERFACES_ALL_HPP_INCLUDED diff --git a/src/catch2/matchers/catch_matchers_all.hpp b/src/catch2/matchers/catch_matchers_all.hpp new file mode 100644 index 00000000..f7eb207e --- /dev/null +++ b/src/catch2/matchers/catch_matchers_all.hpp @@ -0,0 +1,27 @@ +/** \file + * This is a convenience header for Catch2's Matcher support. It includes + * **all** of Catch2 headers related to matchers. + * + * Generally the Catch2 users should use specific includes they need, + * but this header can be used instead for ease-of-experimentation, or + * just plain convenience, at the cost of increased compilation times. + * + * When a new header is added to either the `matchers` folder, or to + * the corresponding internal subfolder, it should be added here. + */ + +#ifndef CATCH_MATCHERS_ALL_HPP_INCLUDED +#define CATCH_MATCHERS_ALL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // CATCH_MATCHERS_ALL_HPP_INCLUDED diff --git a/src/catch2/reporters/catch_reporters_all.hpp b/src/catch2/reporters/catch_reporters_all.hpp new file mode 100644 index 00000000..e18a1ace --- /dev/null +++ b/src/catch2/reporters/catch_reporters_all.hpp @@ -0,0 +1,28 @@ +/** \file + * This is a convenience header for Catch2's Reporter support. It includes + * **all** of Catch2 headers related to reporters, including all reporters. + * + * Generally the Catch2 users should use specific includes they need, + * but this header can be used instead for ease-of-experimentation, or + * just plain convenience, at the cost of (significantly) increased + * compilation times. + * + * When a new header (reporter) is added to either the `reporter` folder, + * or to the corresponding internal subfolder, it should be added here. + */ + +#ifndef CATCH_REPORTERS_ALL_HPP_INCLUDED +#define CATCH_REPORTERS_ALL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // CATCH_REPORTERS_ALL_HPP_INCLUDED