• 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
9[section:test_naming Tests naming]
10
11[h2 Acceptable characters for names]
12The __UTF__ is flexible on the naming the test units (test cases/suites) and
13it is possible to use a wide variety of characters. However there are scenarios
14where the name of a test unit may collide with other features
15of the __UTF__. For instance:
16
17* a character may collide with specific command line filters for selecting a
18  subset of the test tree. Among those characters: `'@'`, `'+'` or `'/'`
19  (see [link boost_test.runtime_config.test_unit_filtering this section] for
20  more details)
21* a name containing a character that is reserved for the shell/terminal, such as
22  '!', '\*' ..., may prevent the test name to be passed on the command line *as is*.
23
24To prevent any conflicting declaration, the __UTF__ *sanitizes* the name given to
25a test unit (case or suite), prior to adding the test to the test tree. Any
26conflicting character is replaced by an underscore `'_'`.
27
28[note [*Spaces] are not considered as /special chars/ and are preserved, except for the
29 leading and trailing spaces which are removed.]
30
31[note The sanitization of the test unit names has been introduced in [link ref_CHANGE_LOG_3_7 Boost 1.67].
32 ]
33
34[h2 Constraints on test names]
35The __UTF__ considers an error if two sibling test cases have the same name. This consistency check is performed
36at runtime and is not sensitive to test filtering.
37
38For test-cases registered automatically, and within the same compilation unit, a compilation error should be raised by
39the compiler in case of name conflict.
40For manual registration of test cases and in case of conflicts, the too __BOOST_TEST_CASE_NAME__ may be used.
41
42The data driven tests are automatically created in an isolated test-suite and with a name that is indexed on the
43sample.
44
45
46[note This constraints does not apply to test-suites: Opening/closing a test-suite declaration
47 adds the test-cases to an existing or newly created test-suite of that name.]
48
49[endsect] [/ test test_naming]
50