Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions doc/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,28 @@ API Reference
DEPENDS lib1 lib2
)

The Python files containing :term:`Pytest` tests can also be explicitly
set as dependencies, ensuring that the target rebuilds whenever these files
are modified::

pytest_discover_tests(
...
DEPENDS
/path/to/test_foo.py
/path/to/test_bar.py
)

For convenience, you can use the `GLOB_RECURSE
<https://cmake.org/cmake/help/latest/command/file.html#glob-recurse>`_
command to dynamically gather all test files::

file(GLOB_RECURSE test_files "/path/to/tests/*.py")

pytest_discover_tests(
...
DEPENDS ${test_files}
)

* ``BUNDLE_TESTS``

Indicate whether Python tests should be bundled under a single
Expand Down
8 changes: 8 additions & 0 deletions doc/release/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
Release Notes
*************

.. release:: Upcoming

.. change:: changed

Updated the :ref:`api_reference` section to include details on how ``DEPENDS``
can be used to ensure the target rebuilds whenever the Python files containing
:term:`Pytest` tests are modified. Thanks :github_user:`AmeyaVSingh`!

.. release:: 0.11.2
:date: 2025-01-18

Expand Down
Loading