Skip to content

Commit

Permalink
CTest: more docs on -R regular expression filtering (ECP-WarpX#5257)
Browse files Browse the repository at this point in the history
* CTest: more docs on `-R` regular expression filtering

* Simplify

* Regex101 Lijnk

* Rephrase

* Rephrase

Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com>

---------

Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
  • Loading branch information
EZoni and ax3l authored Sep 13, 2024
1 parent c9220fb commit 73e1f84
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Docs/source/developers/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ For easier debugging, it can be convenient to run the tests on your local machin
ctest --test-dir build -E laser_acceleration
* Sometimes two or more tests share a large number of input parameters and differ by a small set of options.
Such tests typically also share a base string in their names.
For example, you can find three different tests named ``test_3d_langmuir_multi``, ``test_3d_langmuir_multi_nodal`` and ``test_3d_langmuir_multi_picmi``.
In such a case, if you wish to run the test ``test_3d_langmuir_multi`` only, this can be done again with the ``-R`` regular `expression filter <https://regex101.com>`__ via

.. code-block:: sh
ctest --test-dir build -R "test_3d_langmuir_multi\..*"
Note that filtering with ``-R "test_3d_langmuir_multi"`` would include the additional tests that have the same substring in their name and would not be sufficient to isolate a single test.
Note also that the escaping ``\.`` in the regular expression is necessary in order to take into account the fact that each test is automatically appended with the strings ``.run``, ``.analysis`` and possibly ``.cleanup``.

* Run only tests not labeled with the ``slow`` label:

.. code-block:: sh
Expand Down Expand Up @@ -161,7 +173,7 @@ A new test can be added by adding a corresponding entry in ``CMakeLists.txt`` as
If you need a new Python package dependency for testing, please add it in `Regression/requirements.txt <https://github.com/ECP-WarpX/WarpX/blob/development/Regression/requirements.txt>`__.

Sometimes, two tests share a large number of input parameters. The shared input parameters can be collected in a "base" input file that can be passed as a runtime parameter in the actual test input files through the parameter ``FILE``.
Sometimes two or more tests share a large number of input parameters. The shared input parameters can be collected in a "base" input file that can be passed as a runtime parameter in the actual test input files through the parameter ``FILE``.

Naming conventions for automated tests
--------------------------------------
Expand Down

0 comments on commit 73e1f84

Please sign in to comment.