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
Regenerated single header
- Commit
4a0a70a82e7c8bc3727e02197be3634d1c3b1cde- Author
- Phil Nash ·
- Parents
3fd7dc02185b
Changes
single_include/catch.hpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/single_include/catch.hpp b/single_include/catch.hpp index e785c347..c808f605 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -2706,7 +2706,7 @@ namespace Catch ) const { - return *m_test == *other.m_test && m_name == other.m_name && m_description == other.m_description; + return *m_test == *other.m_test && m_name == other.m_name; } /////////////////////////////////////////////////////////////////////// @@ -2716,12 +2716,7 @@ namespace Catch ) const { - if( m_name < other.m_name ) - return true; - if( m_name > other.m_name ) - return false; - - return *m_test < *other.m_test; + return m_name < other.m_name; } private: @@ -3110,6 +3105,14 @@ namespace Catch m_functions.insert( testInfo ); m_functionsInOrder.push_back( testInfo ); } + else + { + const TestCaseInfo& prev = *m_functions.find( testInfo ); + std::cerr << "error: TEST_CASE( \"" << testInfo.getName() << "\" ) already defined.\n" + << "\tFirst seen at " << prev.getFilename() << ":" << prev.getLine() << "\n" + << "\tRedefined at " << testInfo.getFilename() << ":" << testInfo.getLine() << std::endl; + exit(1); + } } ///////////////////////////////////////////////////////////////////////////