summaryrefslogtreecommitdiff
path: root/src/cppunit/TestFactoryRegistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cppunit/TestFactoryRegistry.cpp')
-rw-r--r--src/cppunit/TestFactoryRegistry.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cppunit/TestFactoryRegistry.cpp b/src/cppunit/TestFactoryRegistry.cpp
index 35448a6..3b68d58 100644
--- a/src/cppunit/TestFactoryRegistry.cpp
+++ b/src/cppunit/TestFactoryRegistry.cpp
@@ -143,12 +143,20 @@ TestFactoryRegistry::makeTest()
void
TestFactoryRegistry::addTestToSuite( TestSuite *suite )
{
+ std::multimap<std::string, Test *> sorted;
for ( Factories::iterator it = m_factories.begin();
it != m_factories.end();
++it )
{
TestFactory *factory = *it;
- suite->addTest( factory->makeTest() );
+ Test *test = factory->makeTest();
+ sorted.insert({test->getName(), test});
+ }
+ // In the unlikely case of multiple Tests with identical names, those will
+ // still be added in random order:
+ for (auto const &i: sorted)
+ {
+ suite->addTest( i.second );
}
}