Boost C++ Libraries: Ticket #1723: No subprocess can be started in init_unit_test_suite https://svn.boost.org/trac10/ticket/1723 <p> As reported in <a class="ext-link" href="http://article.gmane.org/gmane.comp.lib.boost.devel/172560"><span class="icon">​</span>http://article.gmane.org/gmane.comp.lib.boost.devel/172560</a> (Boost.Test: "Test setup error: child has exited" error with RC2, Message-ID: &lt;20080325124954.GB10116@…&gt;): </p> <p> I got a new error once I try to start my test: Test setup error: child has exited; pid: 1001; uid: 20576; exit value: 0 The problem seems to be related to a std::system() call, which I do not understand! Without it it works! Here is my test code: #include &lt;cstdlib&gt; #include &lt;boost/test/included/unit_test_framework.hpp&gt; using boost::unit_test::test_suite; void Vektor3Test1() { } test_suite* Vektor3_test_suite() { </p> <blockquote> <p> test_suite *test = BOOST_TEST_SUITE("Vektor3 test suite"); test-&gt;add(BOOST_TEST_CASE(&amp;Vektor3Test1)); </p> </blockquote> <p> </p> <blockquote> <p> return test; </p> </blockquote> <p> } </p> <p> test_suite* init_unit_test_suite(int, char *[]) { </p> <blockquote> <p> std::system("true"); <em> leads to "Test setup error: child has exited; pid: 1001; uid: 30540; exit value: 0" </em></p> </blockquote> <p> </p> <blockquote> <p> test_suite *test = BOOST_TEST_SUITE("Master test suite"); test-&gt;add(Vektor3_test_suite()); return test; </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1723 Trac 1.4.3 Gennadiy Rozental Mon, 07 Jul 2008 03:21:55 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1723#comment:1 https://svn.boost.org/trac10/ticket/1723#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> fixed in svn already </p> Ticket anonymous Wed, 20 Aug 2008 07:31:16 GMT <link>https://svn.boost.org/trac10/ticket/1723#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1723#comment:2</guid> <description> <p> This bug does not seem to be fixed in Boost 1.36.0. I still obtain errors when child processes exit with return code 0. </p> <p> Test setup error: child has exited; pid: 503; uid: 26975; exit value: 0 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 20 Aug 2008 14:36:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1723#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1723#comment:3</guid> <description> <p> You can disable catching this error with the environment variable BOOST_TEST_CATCH_SYSTEM_ERROR=no </p> </description> <category>Ticket</category> </item> <item> <author>tim@…</author> <pubDate>Thu, 11 Sep 2008 11:25:34 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/1723 https://svn.boost.org/trac10/ticket/1723 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">0001-fix-for-boost.test.patch</span> </li> </ul> <p> fix for 1.36 </p> Ticket anonymous Fri, 26 Sep 2008 10:55:55 GMT <link>https://svn.boost.org/trac10/ticket/1723#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1723#comment:4</guid> <description> <p> I'm finding that the patch prevents the error message but doesn't cause the code after the system() call (within the BOOST_AUTO_TEST_CASE) to be executed. </p> <p> For example: </p> <pre class="wiki">BOOST_AUTO_TEST_CASE(MyTestCase) { cerr &lt;&lt; "Before command" &lt;&lt; endl; system("echo Command"); cerr &lt;&lt; "After command" &lt;&lt; endl; BOOST_CHECK_EQUAL(1, 1); } </pre><p> ...gives output which includes the following... </p> <pre class="wiki">Entering test case "MyTestCase" Before command Command Test case MyTestCase doesn't include any assertions *************************************************** Leaving test case "MyTestCase" </pre><p> This is the case after I have applied the patch and set the environment variable BOOST_TEST_CATCH_SYSTEM_ERROR to "no". </p> <p> Thanks very much for your help. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 06 Oct 2008 05:08:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1723#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1723#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/1723#comment:3" title="Comment 3">anonymous</a>: </p> <blockquote class="citation"> <p> You can disable catching this error with the environment variable BOOST_TEST_CATCH_SYSTEM_ERROR=no </p> </blockquote> <p> Not that this should be </p> <p> BOOST_TEST_CATCH_SYSTEM_ERRORS=no rather than BOOST_TEST_CATCH_SYSTEM_ERROR=no </p> </description> <category>Ticket</category> </item> </channel> </rss>