mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-30 01:03:30 +01:00
Merge branch 'rcdailey-throw-on-duplicate-tests'
This commit is contained in:
commit
1ebebd4ab8
@ -61,12 +61,14 @@ namespace Catch {
|
|||||||
++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 )
|
|
||||||
|
ss << Colour( Colour::Red )
|
||||||
<< "error: TEST_CASE( \"" << it->name << "\" ) already defined.\n"
|
<< "error: TEST_CASE( \"" << it->name << "\" ) already defined.\n"
|
||||||
<< "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n"
|
<< "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n"
|
||||||
<< "\tRedefined at " << it->getTestCaseInfo().lineInfo << std::endl;
|
<< "\tRedefined at " << it->getTestCaseInfo().lineInfo << std::endl;
|
||||||
exit(1);
|
|
||||||
|
throw std::runtime_error(ss.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user