<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 182: Registered test suites in undeterministic order</title><link>https://sourceforge.net/p/cppunit/bugs/182/</link><description>Recent changes to 182: Registered test suites in undeterministic order</description><atom:link href="https://sourceforge.net/p/cppunit/bugs/182/feed.rss" rel="self"/><language>en</language><lastBuildDate>Wed, 19 Sep 2007 09:29:49 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/cppunit/bugs/182/feed.rss" rel="self" type="application/rss+xml"/><item><title>Registered test suites in undeterministic order</title><link>https://sourceforge.net/p/cppunit/bugs/182/</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Magnus Larsson</dc:creator><pubDate>Wed, 19 Sep 2007 09:29:49 -0000</pubDate><guid>https://sourceforge.netd9b7240de5cfe41819c5dc55392d1c7d433b765a</guid></item></channel></rss>