<html> <head> <title>CppTest - A C++ Unit Testing Framework</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </head> <body bgcolor="#ffffff"> <table width="100%"> <tr> <td width="40%" align="right" valign="center"> <a href="http://cpptest.sourceforge.net">CppTest home page</a> </td> <td></td> <td width="40%" align="left" valign="center"> <a href="http://sourceforge.net/projects/cpptest">CppTest project page</a> </td> </tr> </table> <hr> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="namespaceTest.html">Test</a>::<a class="el" href="classTest_1_1Suite.html">Suite</a> </div> </div> <div class="contents"> <h1>Test::Suite Class Reference</h1><!-- doxytag: class="Test::Suite" -->Unit testing suite. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="cpptest-suite_8h_source.html">cpptest-suite.h</a>></code> <p> <p> <a href="classTest_1_1Suite-members.html">List of all members.</a><h2>Public Member Functions</h2> <ul> <li><a class="el" href="classTest_1_1Suite.html#8cb51a002cf4e675820f91fe03ec9117">Suite</a> () <li>virtual <a class="el" href="classTest_1_1Suite.html#7a62f450d1e6c86cd6058e1c457aa4b7">~Suite</a> () <li><a class="anchor" name="0237b63fc694ecb133d023cf2d6ab271"></a><!-- doxytag: member="Test::Suite::add" ref="0237b63fc694ecb133d023cf2d6ab271" args="(std::auto_ptr< Suite > suite)" --> void <b>add</b> (std::auto_ptr< <a class="el" href="classTest_1_1Suite.html">Suite</a> > suite) <li>bool <a class="el" href="classTest_1_1Suite.html#d17746e218da79c537bc9d21e389f570">run</a> (<a class="el" href="classTest_1_1Output.html">Output</a> &output, bool cont_after_fail=true) </ul> <h2>Protected Types</h2> <ul> <li>typedef void(Suite::* <a class="el" href="classTest_1_1Suite.html#d615423c0b8dba3faead3b352d6f5cbd">Func</a> )() </ul> <h2>Protected Member Functions</h2> <ul> <li><a class="anchor" name="76d5fbd5dafa352f6086f8ab0db3089f"></a><!-- doxytag: member="Test::Suite::continue_after_failure" ref="76d5fbd5dafa352f6086f8ab0db3089f" args="() const " --> bool <b>continue_after_failure</b> () const <li>virtual void <a class="el" href="classTest_1_1Suite.html#fb4c733e6c46a011818bb02f2e8d5bb8">setup</a> () <li>virtual void <a class="el" href="classTest_1_1Suite.html#37d3595625cff09b8e43bf6c414ff610">tear_down</a> () <li><a class="anchor" name="11e542d1d45905b817b00c35660700b9"></a><!-- doxytag: member="Test::Suite::register_test" ref="11e542d1d45905b817b00c35660700b9" args="(Func func, const std::string &name)" --> void <b>register_test</b> (<a class="el" href="classTest_1_1Suite.html#d615423c0b8dba3faead3b352d6f5cbd">Func</a> func, const std::string &name) <li>void <a class="el" href="classTest_1_1Suite.html#1851ad75aed6141a19a06eeeb0fe0d3c">assertment</a> (<a class="el" href="classTest_1_1Source.html">Source</a> s) </ul> <h2>Friends</h2> <ul> <li><a class="anchor" name="843435d7ee79d23ed13e6eec5c7ac6bb"></a><!-- doxytag: member="Test::Suite::DoRun" ref="843435d7ee79d23ed13e6eec5c7ac6bb" args="" --> struct <b>DoRun</b> <li><a class="anchor" name="b4730d33c1241aba407b71f8eafb7bcc"></a><!-- doxytag: member="Test::Suite::ExecTests" ref="b4730d33c1241aba407b71f8eafb7bcc" args="" --> struct <b>ExecTests</b> <li><a class="anchor" name="901d2d72cc93e087c94d99680f65fa8e"></a><!-- doxytag: member="Test::Suite::SubSuiteTests" ref="901d2d72cc93e087c94d99680f65fa8e" args="" --> struct <b>SubSuiteTests</b> <li><a class="anchor" name="5933776e455e5bd9ad1d4a8b1c591aa2"></a><!-- doxytag: member="Test::Suite::SubSuiteTime" ref="5933776e455e5bd9ad1d4a8b1c591aa2" args="" --> struct <b>SubSuiteTime</b> </ul> <hr><a name="_details"></a><h2>Detailed Description</h2> Unit testing suite. <p> Base class for all suites. Derive from this class to create own test suites.<p> Test functions in derived classes are registered as tests using the <a class="el" href="cpptest-suite_8h.html#be8c3e0a2cf3893ebc1c265264ed9cb8">TEST_ADD(func)</a>. Testing is started by <a class="el" href="classTest_1_1Suite.html#d17746e218da79c537bc9d21e389f570">run()</a>. Note that suites may be embedded in other suites using add(). <hr><h2>Member Typedef Documentation</h2> <a class="anchor" name="d615423c0b8dba3faead3b352d6f5cbd"></a><!-- doxytag: member="Test::Suite::Func" ref="d615423c0b8dba3faead3b352d6f5cbd" args=")()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef void(Suite::* <a class="el" href="classTest_1_1Suite.html#d615423c0b8dba3faead3b352d6f5cbd">Test::Suite::Func</a>)()<code> [protected]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> Pointer to a test function. </div> </div><p> <hr><h2>Constructor & Destructor Documentation</h2> <a class="anchor" name="8cb51a002cf4e675820f91fe03ec9117"></a><!-- doxytag: member="Test::Suite::Suite" ref="8cb51a002cf4e675820f91fe03ec9117" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Test::Suite::Suite </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Constructs an empty test suite. </div> </div><p> <a class="anchor" name="7a62f450d1e6c86cd6058e1c457aa4b7"></a><!-- doxytag: member="Test::Suite::~Suite" ref="7a62f450d1e6c86cd6058e1c457aa4b7" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Test::Suite::~Suite </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Destroys this suite object. </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="d17746e218da79c537bc9d21e389f570"></a><!-- doxytag: member="Test::Suite::run" ref="d17746e218da79c537bc9d21e389f570" args="(Output &output, bool cont_after_fail=true)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool Test::Suite::run </td> <td>(</td> <td class="paramtype"><a class="el" href="classTest_1_1Output.html">Output</a> & </td> <td class="paramname"> <em>output</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"> <em>cont_after_fail</em> = <code>true</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Starts the testing. All tests in this suite and embedded suites will be executed.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>output</em> </td><td>Progress report destination. </td></tr> <tr><td valign="top"></td><td valign="top"><em>cont_after_fail</em> </td><td>Continue functions despite failures.</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>True if no test failed; false otherwise. </dd></dl> <p>References <a class="el" href="cpptest-output_8h_source.html#l00076">Test::Output::finished()</a>, and <a class="el" href="cpptest-output_8h_source.html#l00066">Test::Output::initialize()</a>.</p> </div> </div><p> <a class="anchor" name="fb4c733e6c46a011818bb02f2e8d5bb8"></a><!-- doxytag: member="Test::Suite::setup" ref="fb4c733e6c46a011818bb02f2e8d5bb8" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Test::Suite::setup </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [inline, protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Setups a test fixture. This function is called before each test, in this suite, is executed.<p> This function should be overloaded by derived classes to provide specialized behavior.<p> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classTest_1_1Suite.html#37d3595625cff09b8e43bf6c414ff610">tear_down()</a> </dd></dl> </div> </div><p> <a class="anchor" name="37d3595625cff09b8e43bf6c414ff610"></a><!-- doxytag: member="Test::Suite::tear_down" ref="37d3595625cff09b8e43bf6c414ff610" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Test::Suite::tear_down </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td><code> [inline, protected, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Tears down a test fixture. This function is called after each test, in this suite, have been executed.<p> This function should be overloaded by derived classes to provide specialized behavior.<p> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classTest_1_1Suite.html#fb4c733e6c46a011818bb02f2e8d5bb8">setup()</a> </dd></dl> </div> </div><p> <a class="anchor" name="1851ad75aed6141a19a06eeeb0fe0d3c"></a><!-- doxytag: member="Test::Suite::assertment" ref="1851ad75aed6141a19a06eeeb0fe0d3c" args="(Source s)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Test::Suite::assertment </td> <td>(</td> <td class="paramtype"><a class="el" href="classTest_1_1Source.html">Source</a> </td> <td class="paramname"> <em>s</em> </td> <td> ) </td> <td><code> [protected]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Issues an assertment to the output handler.<p> Do not call this function directly, use one of the available assertment macros instead, see <a class="el" href="asserts.html">Available asserts</a>.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>Assert point information. </td></tr> </table> </dl> <p>References <a class="el" href="cpptest-output_8h_source.html#l00135">Test::Output::assertment()</a>.</p> </div> </div><p> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="cpptest-suite_8h_source.html">cpptest-suite.h</a><li>suite.cpp</ul> </div> <hr> <div align="center"> Supported by: <br><br> <img src="http://sourceforge.net/sflogo.php?group_id=77564" width="88" height="31" border="0" alt="SourceForge Logo"></a> </div> </body> </html>