test_naming.qbk 2.2 KB

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