Skip to content

Commit dcc451c

Browse files
authored
Merge pull request #11911 from StarryWorm/update-tests-docs
Update tests docs
2 parents 10b1996 + 32ddb66 commit dcc451c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

engine_details/architecture/unit_testing.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,20 @@ order to skip those kind of tests, run the following command:
102102
Writing tests
103103
-------------
104104

105-
Test suites represent C++ header files which must be included as part of the
106-
main test entry point in ``tests/test_main.cpp``. Most test suites are located
107-
directly under ``tests/`` directory.
105+
Test suites represent C++ implementation files which must include the ``TEST_FORCE_LINK()`` macro.
106+
Most test suites are located directly under ``tests/`` directory.
108107

109-
All header files are prefixed with ``test_``, and this is a naming convention
108+
All test files are prefixed with ``test_``, and this is a naming convention
110109
which the Godot build system relies on to detect tests throughout the engine.
111110

112111
Here's a minimal working test suite with a single test case written:
113112

114113
.. code-block:: cpp
115114
116-
#pragma once
117-
118115
#include "tests/test_macros.h"
119116
117+
TEST_FORCE_LINK(test_string)
118+
120119
namespace TestString {
121120
122121
TEST_CASE("[String] Hello World!") {
@@ -129,7 +128,6 @@ Here's a minimal working test suite with a single test case written:
129128
.. note::
130129
You can quickly generate new tests using the ``create_test.py`` script found in the ``tests/`` directory.
131130
This script automatically creates a new test file with the required boilerplate code in the appropriate location.
132-
It's also able to automatically include the new header in ``tests/test_main.cpp`` using invasive mode (``-i`` flag).
133131
To view usage instructions, run the script with the ``-h`` flag.
134132

135133
The ``tests/test_macros.h`` header encapsulates everything which is needed for

0 commit comments

Comments
 (0)