test_tree.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Test tree</title>
  5. <link rel="stylesheet" href="../../boostbook.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="../../index.html" title="Boost.Test">
  8. <link rel="up" href="../tests_organization.html" title="Declaring and organizing tests">
  9. <link rel="prev" href="test_cases/param_test.html" title="Parametrized test cases">
  10. <link rel="next" href="test_tree/test_suite.html" title="Test suite">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
  15. <td align="center"><a href="../../../../../../index.html">Home</a></td>
  16. <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
  17. <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
  18. <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
  19. <td align="center"><a href="../../../../../../more/index.htm">More</a></td>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="test_cases/param_test.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tests_organization.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="test_tree/test_suite.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="section">
  26. <div class="titlepage"><div><div><h3 class="title">
  27. <a name="boost_test.tests_organization.test_tree"></a><a class="link" href="test_tree.html" title="Test tree">Test tree</a>
  28. </h3></div></div></div>
  29. <div class="toc"><dl class="toc">
  30. <dt><span class="section"><a href="test_tree/test_suite.html">Test
  31. suite</a></span></dt>
  32. <dt><span class="section"><a href="test_tree/master_test_suite.html">Master
  33. test suite</a></span></dt>
  34. <dt><span class="section"><a href="test_tree/test_naming.html">Tests
  35. naming</a></span></dt>
  36. <dt><span class="section"><a href="test_tree/test_tree_content.html">Test
  37. tree content</a></span></dt>
  38. </dl></div>
  39. <p>
  40. The test tree is the hierarchy of test cases and test suites, along with
  41. all the fixtures (global, case or suite level), and the respective dependencies
  42. within all those elements.
  43. </p>
  44. <p>
  45. A test tree is composed with:
  46. </p>
  47. <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
  48. <li class="listitem">
  49. Test cases: those are the elements in the tree that contain the body
  50. of the tests, and they constitute the <span class="bold"><strong>leaves</strong></span>
  51. of the tree.
  52. </li>
  53. <li class="listitem">
  54. Test suites: those are the are internal nodes of the tree. These elements
  55. that do not have any body or executable code themselves, but fixtures
  56. that execute code and tests can be attached to them.
  57. </li>
  58. <li class="listitem">
  59. The master test suite: this is the root of the tree, and is by definition
  60. a test suite. Fixtures attached to the master test suite are <span class="bold"><strong>global</strong></span> fixtures.
  61. </li>
  62. <li class="listitem">
  63. fixtures: those are units of code that are executed before and/or after
  64. the test units above.
  65. </li>
  66. </ul></div>
  67. <p>
  68. The following hierarchy represents a test tree (further detailed in the
  69. <a class="link" href="test_tree/test_suite.html" title="Test suite">test-suite</a>
  70. section) <span class="bold"><strong>without</strong></span> any fixture:
  71. </p>
  72. <p>
  73. <span class="inlinemediaobject"><img src="../../images/class-hier.jpg"></span>
  74. </p>
  75. <p>
  76. <a class="link" href="decorators.html" title="Decorators">Decoration</a>
  77. can be added to test suites and cases except for the master test suite. Those
  78. decoration may modify the way the <span class="emphasis"><em>Unit Test Framework</em></span>
  79. handles the tree. For instance, there is no defined order in the execution
  80. of test cases enforced by the tree itself, except for the fixtures and the
  81. elements they relate to (suite, case); decoration may be used to instruct
  82. a specific order among the elements of the tree.
  83. </p>
  84. <div class="note"><table border="0" summary="Note">
  85. <tr>
  86. <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/src/images/note.png"></td>
  87. <th align="left">Note</th>
  88. </tr>
  89. <tr><td align="left" valign="top"><p>
  90. The test-tree by itself does not give any particular order in the execution
  91. of the test-cases. The only implicit order is given by the fixtures. To
  92. indicate a particular order, specific decorators should be used.
  93. </p></td></tr>
  94. </table></div>
  95. </div>
  96. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  97. <td align="left"></td>
  98. <td align="right"><div class="copyright-footer">Copyright &#169; 2001-2019 Boost.Test
  99. contributors<p>
  100. Distributed under the Boost Software License, Version 1.0. (See accompanying
  101. file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
  102. </p>
  103. </div></td>
  104. </tr></table>
  105. <hr>
  106. <div class="spirit-nav">
  107. <a accesskey="p" href="test_cases/param_test.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tests_organization.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="test_tree/test_suite.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
  108. </div>
  109. </body>
  110. </html>