mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Merge branch 'throw-on-duplicate-tests' of git://github.com/rcdailey/Catch into rcdailey-throw-on-duplicate-tests
This commit is contained in:
		| @@ -60,13 +60,15 @@ namespace Catch { | |||||||
|             it != itEnd; |             it != itEnd; | ||||||
|             ++it ) { |             ++it ) { | ||||||
|             std::pair<std::set<TestCase>::const_iterator, bool> prev = seenFunctions.insert( *it ); |             std::pair<std::set<TestCase>::const_iterator, bool> prev = seenFunctions.insert( *it ); | ||||||
|             if( !prev.second ){ |             if( !prev.second ) { | ||||||
|                 Catch::cerr() |                 std::ostringstream ss; | ||||||
|                 << Colour( Colour::Red ) |  | ||||||
|                 << "error: TEST_CASE( \"" << it->name << "\" ) already defined.\n" |                 ss  << Colour( Colour::Red ) | ||||||
|                 << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n" |                     << "error: TEST_CASE( \"" << it->name << "\" ) already defined.\n" | ||||||
|                 << "\tRedefined at " << it->getTestCaseInfo().lineInfo << std::endl; |                     << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n" | ||||||
|                 exit(1); |                     << "\tRedefined at " << it->getTestCaseInfo().lineInfo << std::endl; | ||||||
|  |  | ||||||
|  |                 throw std::runtime_error(ss.str()); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash