<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 182: Registered test suites in undeterministic order</title><link href="https://sourceforge.net/p/cppunit/bugs/182/" rel="alternate"/><link href="https://sourceforge.net/p/cppunit/bugs/182/feed.atom" rel="self"/><id>https://sourceforge.net/p/cppunit/bugs/182/</id><updated>2007-09-19T09:29:49Z</updated><subtitle>Recent changes to 182: Registered test suites in undeterministic order</subtitle><entry><title>Registered test suites in undeterministic order</title><link href="https://sourceforge.net/p/cppunit/bugs/182/" rel="alternate"/><published>2007-09-19T09:29:49Z</published><updated>2007-09-19T09:29:49Z</updated><author><name>Magnus Larsson</name><uri>https://sourceforge.net/u/malar42/</uri></author><id>https://sourceforge.netd9b7240de5cfe41819c5dc55392d1c7d433b765a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am involved in starting up an effort to convert the unit tests for a rather large C-code base (&amp;gt;3MLOC) from a "homegrown" unit test framework to CppUnit. &lt;br /&gt;
A problem we have encountered is that when registering test suites with the CPPUNIT_TEST_SUITE_REGISTRATION macro, they are executed in basically an undeterministic order (CppUnit 1.12.0/Windows/VS2005). We need to be able to control the execution order, that is, we want them executed in the order the macros are stated.&lt;/p&gt;
&lt;p&gt;I think this would be a reasonable requirement?&lt;/p&gt;
&lt;p&gt;Some digging in the framework reveals that the underlying container for the registered suites is an STL set, which sorts the entries depending on the value of the object pointer. I did a "quick-and-dirty" fix by implementing my own comparison, using a counter that is incremented in the constructor of the TestFactory object. A better solution could be to use an STL list instead?&lt;/p&gt;
&lt;p&gt;We would of course very much prefer this to be incorporated in the framework, instead of maintaining our own. If I get some hints on a suitable solution, I could attempt and contribute an implementation. &lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;
Magnus&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>