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 last usage of NotImplementedException

TeamCity reporter now uses CATCH_ERROR instead
Commit
6388fc946fccbad45be0a01e26e74904bac11977
Author
Martin Hořeňovský ·
Parents
a4df0b2c37f4

Files · Download .tar.gz

Changes

 CMakeLists.txt                                     |  2 --
 include/internal/catch_impl.hpp                    |  3 --
 .../internal/catch_notimplemented_exception.cpp    | 25 ----------------
 include/internal/catch_notimplemented_exception.h  | 35 ----------------------
 include/reporters/catch_reporter_teamcity.hpp      |  4 +--
 5 files changed, 2 insertions(+), 67 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ad104328..592b7c05 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -156,7 +156,6 @@ set(INTERNAL_HEADERS
         ${HEADER_DIR}/internal/catch_matchers_string.h
         ${HEADER_DIR}/internal/catch_matchers_vector.h
         ${HEADER_DIR}/internal/catch_message.h
-        ${HEADER_DIR}/internal/catch_notimplemented_exception.h
         ${HEADER_DIR}/internal/catch_objc.hpp
         ${HEADER_DIR}/internal/catch_objc_arc.hpp
         ${HEADER_DIR}/internal/catch_option.hpp
@@ -216,7 +215,6 @@ set(IMPL_SOURCES
         ${HEADER_DIR}/internal/catch_matchers.cpp
         ${HEADER_DIR}/internal/catch_matchers_string.cpp
         ${HEADER_DIR}/internal/catch_message.cpp
-        ${HEADER_DIR}/internal/catch_notimplemented_exception.cpp
         ${HEADER_DIR}/internal/catch_registry_hub.cpp
         ${HEADER_DIR}/internal/catch_interfaces_reporter.cpp
         ${HEADER_DIR}/internal/catch_random_number_generator.cpp
diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp
index 785f3ddc..d9a644d0 100644
--- a/include/internal/catch_impl.hpp
+++ b/include/internal/catch_impl.hpp
@@ -17,9 +17,6 @@
 #endif
 
 
-#include "internal/catch_notimplemented_exception.h"
-
-
 // Temporary hack to fix separately provided reporters
 #include "../reporters/catch_reporter_bases.hpp"
 #include "catch_reporter_registrars.hpp"
diff --git a/include/internal/catch_notimplemented_exception.cpp b/include/internal/catch_notimplemented_exception.cpp
deleted file mode 100644
index f44d8e10..00000000
--- a/include/internal/catch_notimplemented_exception.cpp
+++ /dev/null
@@ -1,25 +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)
- */
-
-#include "catch_notimplemented_exception.h"
-#include <sstream>
-
-namespace Catch {
-
-    NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo ) {
-        std::ostringstream oss;
-        oss << lineInfo << ": function ";
-        oss << "not implemented";
-        m_what = oss.str();
-    }
-
-    const char* NotImplementedException::what() const noexcept {
-        return m_what.c_str();
-    }
-
-} // end namespace Catch
diff --git a/include/internal/catch_notimplemented_exception.h b/include/internal/catch_notimplemented_exception.h
deleted file mode 100644
index 19e185b6..00000000
--- a/include/internal/catch_notimplemented_exception.h
+++ /dev/null
@@ -1,35 +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_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED
-#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED
-
-#include "catch_common.h"
-
-#include <exception>
-
-namespace Catch {
-
-    class NotImplementedException : public std::exception
-    {
-    public:
-        NotImplementedException( SourceLineInfo const& lineInfo );
-
-        virtual ~NotImplementedException() noexcept = default;
-
-        virtual const char* what() const noexcept override;
-
-    private:
-        std::string m_what;
-    };
-
-} // end namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO )
-
-#endif // TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED
diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp
index 3fcbbd4e..d17026a8 100644
--- a/include/reporters/catch_reporter_teamcity.hpp
+++ b/include/reporters/catch_reporter_teamcity.hpp
@@ -97,12 +97,12 @@ namespace Catch {
                     case ResultWas::Ok:
                     case ResultWas::Info:
                     case ResultWas::Warning:
-
+                        CATCH_ERROR( "Internal error in TeamCity reporter" );
                     // These cases are here to prevent compiler warnings
                     case ResultWas::Unknown:
                     case ResultWas::FailureBit:
                     case ResultWas::Exception:
-                        CATCH_NOT_IMPLEMENTED;
+                        CATCH_ERROR( "Not implemented" );
                 }
                 if( assertionStats.infoMessages.size() == 1 )
                     msg << " with message:";