Boost C++ Libraries: Ticket #12902: boost test labels https://svn.boost.org/trac10/ticket/12902 <p> there is a tutorial about new boost test feature - the labels. but it is not clear how to run all tests in testsuite except those that are with a specific label. could you help, please? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12902 Trac 1.4.3 Raffi Enficiaud Sat, 18 Mar 2017 13:30:24 GMT <link>https://svn.boost.org/trac10/ticket/12902#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12902#comment:1</guid> <description> <p> Hi, </p> <p> Do you mean you want at the same time: </p> <ul><li>only a test suite </li><li>exclude one specific label </li></ul><p> ? From <a href="http://www.boost.org/doc/libs/1_63_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/run_test.html">this</a> it says that label and paths are mutually exclusive, but to be honest, I do not know. </p> <p> For preventing a specific label to run, the "<code></code><code>relative_spec</code><code></code>" in the above link should work (using "<code></code><code>!</code><code></code>"). </p> </description> <category>Ticket</category> </item> <item> <author>Paweł Bylica <chfast@…></author> <pubDate>Thu, 23 Mar 2017 10:23:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12902#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12902#comment:2</guid> <description> <p> I think we don't know how to actually combine these 2 filters. I tried something like 'Suite1!label2' but it does not work. </p> <p> The documentation <a href="http://www.boost.org/doc/libs/1_63_0/libs/test/doc/html/boost_test/runtime_config/test_unit_filtering.html#boost_test.runtime_config.test_unit_filtering.command_line_control">http://www.boost.org/doc/libs/1_63_0/libs/test/doc/html/boost_test/runtime_config/test_unit_filtering.html#boost_test.runtime_config.test_unit_filtering.command_line_control</a> specifies "3. Shrink the statically defined set by disabling some of the enabled test cases." But this "shrinking" is never explained. </p> <p> Our use case is "all tests in Suite1 except these marked with label2". </p> <p> Also, can you create an unit test that is disabled by default and will be enabled only if a particular label will be provided, not just test suite path? </p> </description> <category>Ticket</category> </item> <item> <author>Moritz Pflanzer <moritz@…></author> <pubDate>Sun, 07 May 2017 11:13:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12902#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12902#comment:3</guid> <description> <p> I also run into a problem with filtering test cases when labels are involved. For instance I have multiple test suites where each represents a specific feature that will be tested in the suite. Because some of the test cases actually take a long time to run I also added labels "quick" and "slow". The idea was to be able to run only the fast tests, or the slow tests, or all together. </p> <p> My test suite structure looks something like this: </p> <pre class="wiki">F1* test1@slow test2@quick F2* test1@quick test2@slow </pre><p> Selecting based on labels alone works well by specifying <code>--run_test '@slow'</code> etc. It would run the following tests: </p> <pre class="wiki">F1* test1@slow F2* test2@slow </pre><p> It also works if I want to exclude, for example, the slow tests for a specific feature (or a selected subset of the features): <code>--run_test 'F1:!@slow'</code> </p> <pre class="wiki">F1* test1@quick </pre><p> However, if I only want to run the fast tests but exclude one feature (<code>--run_test '@quick:!F1'</code>) it doesn't work. It seems to be impossible to exclude test cases that have been enabled by a label. Though, according to the documentation "<em>the disabler takes the precedence over the enabler.</em>" </p> <pre class="wiki">F1* test2@quick F2* test1@quick </pre><p> Additionally it would be nice to express something like "Run test suite F1 but only the tests labelled quick". I think currently that can only be achieved by negating all labels except for @quick. But if there are many labels it quickly becomes impractical. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Thu, 04 Jan 2018 10:01:13 GMT</pubDate> <title>owner, status, milestone changed https://svn.boost.org/trac10/ticket/12902#comment:4 https://svn.boost.org/trac10/ticket/12902#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Gennadiy Rozental</span> to <span class="trac-author">Raffi Enficiaud</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.66.0</span> </li> </ul> <p> I think there is an easy way to combine labels and path: </p> <ul><li><code>suite1/suite2/@labelX,case3</code> enabling <code>case3</code> and all test cases that have <code>@labelX</code>, both within <code>suite1/suite2</code> </li><li><code>suite1/suite2/!@labelX,case3</code> enabling <code>case3</code> and disabling all test cases that have <code>@labelX</code>, both within <code>suite1/suite2</code> </li><li>disabling should have precedence over enabling </li></ul><p> For the case of <code>--run_test '@quick:!F1'</code> I need to investigate further, and this is actually a bug. </p> <p> Concerning this: </p> <blockquote class="citation"> <p> Also, can you create an unit test that is disabled by default and will be enabled only if a particular label will be provided, not just test suite path? </p> </blockquote> <p> I do not know, I need to check. Stay tuned! </p> Ticket Raffi Enficiaud Thu, 21 Jun 2018 05:13:35 GMT milestone changed https://svn.boost.org/trac10/ticket/12902#comment:5 https://svn.boost.org/trac10/ticket/12902#comment:5 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.66.0</span> → <span class="trac-field-new">Boost 1.68.0</span> </li> </ul> Ticket