Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Remove unused catch_impl.hpp header

It became useless when we moved away from the single-header model,
because it was used an entry point for stitching CPP into the single
header file.
Commit
3f2ada03d5ddf90d7236b9777bb6fcc08808ac8b
Author
Martin Hořeňovský ·
Parents
7892954c9972

Files · Download .tar.gz

Changes

 src/CMakeLists.txt                |  1 -
 src/catch2/catch_default_main.hpp | 13 +++++++++++++
 src/catch2/catch_impl.hpp         | 33 ---------------------------------
 3 files changed, 13 insertions(+), 34 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7a4bebb8..20d15d23 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -60,7 +60,6 @@ set(INTERNAL_HEADERS
     ${SOURCES_DIR}/catch_generators.hpp
     ${SOURCES_DIR}/catch_generators_generic.hpp
     ${SOURCES_DIR}/catch_generators_specific.hpp
-    ${SOURCES_DIR}/catch_impl.hpp
     ${SOURCES_DIR}/catch_interfaces_capture.h
     ${SOURCES_DIR}/catch_interfaces_config.h
     ${SOURCES_DIR}/catch_interfaces_enum_values_registry.h
diff --git a/src/catch2/catch_default_main.hpp b/src/catch2/catch_default_main.hpp
index a61ad98d..4f769695 100644
--- a/src/catch2/catch_default_main.hpp
+++ b/src/catch2/catch_default_main.hpp
@@ -9,8 +9,17 @@
 #define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
 
 #include <catch2/catch_session.h>
+#include <catch2/catch_compiler_capabilities.h>
+#include <catch2/catch_leak_detector.h>
 #include <catch2/catch_platform.h>
 
+namespace Catch {
+    CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
+    CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
+    LeakDetector leakDetector;
+    CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+}
+
 #ifndef __OBJC__
 
 #if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
@@ -21,6 +30,10 @@ extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
 int main (int argc, char * argv[]) {
 #endif
 
+    // We want to force the linker not to discard the global variable
+    // and its constructor, as it (optionally) registers leak detector
+    (void)&Catch::leakDetector;
+
     return Catch::Session().run( argc, argv );
 }
 
diff --git a/src/catch2/catch_impl.hpp b/src/catch2/catch_impl.hpp
deleted file mode 100644
index 681110dc..00000000
--- a/src/catch2/catch_impl.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *  Created by Phil on 5/8/2012.
- *  Copyright 2012 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_IMPL_HPP_INCLUDED
-#define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#endif
-
-// Keep these here for external reporters
-#include <catch2/catch_test_spec.h>
-#include <catch2/catch_test_case_tracker.h>
-
-#include <catch2/catch_leak_detector.h>
-
-// Cpp files will be included in the single-header file here
-// ~*~* CATCH_CPP_STITCH_PLACE *~*~
-
-namespace Catch {
-    LeakDetector leakDetector;
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif // TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED