• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[/
2 / Copyright (c) 2003 Boost.Test contributors
3 /
4 / Distributed under the Boost Software License, Version 1.0. (See accompanying
5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 /]
7
8[section:tests_grouping Grouping tests into logical units by labels]
9
10Test-suites and test cases define a hierarchy called the /test tree/, which is useful for organizing tests. These
11organization defines an implicit grouping of test unit following the /subtrees/ extracted from the test tree, by just
12designing a node on the test tree. Being able to design a group of tests enable, for instance, to execute this group of
13test only (covered in [link boost_test.runtime_config.test_unit_filtering this section]).
14
15However, the subtrees might not reflect all the possible grouping of test units the usage of the test module would
16require [footnote For instance, selecting two siblings without the parent node].
17
18The __UTF__ provides a flexible way of grouping test units by the use of /labels/, using the decorator
19__decorator_label__. It is possible to associate more than one label with a test unit.
20
21Labels can be associated to test cases and test suites. For the latter, the label is inherited by all the nodes in the
22subtree defined by the labelled test suite: decorating a test suite with label `L` is equivalent to decorating every test
23unit inside with `L`.
24
25[tip it is possible to list all labels of a test module from the CLI by using the
26 [link boost_test.utf_reference.rt_param_reference.list_labels `--list_labels`] switch
27]
28
29[bt_example decorator_04..decorator label..run-fail]
30
31
32[endsect]
33