Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In your <code>test_foo.cpp</code>, the macros add test suites and test cases in to a global list: <code>master_testsuite</code>, which is the root of all test nodes. You just need to compile all the test files like <code>test_foo.cpp</code>, <code>test_boo.cpp</code> and a runner, then link them all into on executable.</p> <p>The function <code>unit_test_main</code> is used to run the tests in <code>master_testsuite</code>.</p> <pre><code>boost::unit_test::unit_test_main( &amp;init_unit_test, argc, argv ) </code></pre> <p>Based on the macro you defined before including <code>&lt;boost/test/unit_test.h&gt;</code>, <em>Boost.Test</em> may already generate the <code>main</code> function for you.[1] The generated <code>main</code> simply invoked <code>unit_test_main</code> with <code>argc</code> and <code>argv</code> in <code>main</code>. It's recommended to use <code>unit_test_main</code> because it can process some console arguments, like <a href="http://www.boost.org/doc/libs/1_39_0/libs/test/doc/html/utf/user-guide/runtime-config/run-by-name.html" rel="noreferrer" title="Running Boost Test By Name">run test by name</a>.</p> <p>The first argument of <code>unit_test_main</code> is a hook. Depending on <code>BOOST_TEST_ALTERNATIVE_INIT_API</code>, it has different definition.</p> <pre><code>#ifdef BOOST_TEST_ALTERNATIVE_INIT_API typedef bool (*init_unit_test_func)(); #else typedef test_suite* (*init_unit_test_func)( int, char* [] ); #endif </code></pre> <p>You can customize the <code>master_testsuite</code> in the hook. In the second form, the returned value is the new master testsuite.</p> <p>[1] if <code>BOOST_TEST_MAIN</code> and <code>BOOST_TEST_MAIN</code> are defined, but <code>BOOST_TEST_NO_MAIN</code> is not.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload