Skip to content

Commit 0f8736e

Browse files
authored
Merge pull request #717 from vkarak/docs/check-select-regex
[doc] Add documentation for regular expression support in test selection options
2 parents 20544c7 + 60a01aa commit 0f8736e

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

docs/running.rst

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,29 @@ For example the following will select all the checks that can run with both ``Pr
365365
366366
If you are going to run a set of tests selected by programming environment, they will run only for the selected programming environment(s).
367367

368+
The ``-p`` option accepts also the Python `regular expression syntax <https://docs.python.org/3.6/library/re.html#regular-expression-syntax>`__.
369+
In fact, the argument to ``-p`` option is treated as a regular expression always. This means that the ``-p PrgEnv-gnu`` will match also tests that support a ``PrgEnv-gnuXX`` environment.
370+
If you would like to stricly select tests that support ``PrgEnv-gnu`` only and not ``PrgEnv-gnuXX``, you should write ``-p PrgEnv-gnu$``.
371+
As described above multiple ``-p`` options are AND-ed.
372+
Combining that with regular expressions can be quite powerful.
373+
For example, the following will select all tests that support programming environment ``foo`` and either ``PrgEnv-gnu`` or ``PrgEnv-pgi``:
374+
375+
.. code-block:: bash
376+
377+
./bin/reframe -p foo -p 'PrgEnv-(gnu|pgi)' -l
378+
379+
380+
.. note::
381+
.. versionadded:: 2.17
382+
383+
The ``-p`` option recognizes regular expressions as arguments.
384+
385+
368386
Selecting tests by tags
369387
^^^^^^^^^^^^^^^^^^^^^^^
370388

371-
As we have seen in the `"ReFrame tutorial" <tutorial.html>`__, every regression test may be associated with a set of tags. Using the ``-t`` or ``--tag`` option you can select the regression tests associated with a specific tag.
389+
As we have seen in the `"ReFrame tutorial" <tutorial.html>`__, every regression test may be associated with a set of tags.
390+
Using the ``-t`` or ``--tag`` option you can select the regression tests associated with a specific tag.
372391
For example the following will list all the tests that have a ``maintenance`` tag and can run on the current system:
373392

374393
.. code-block:: bash
@@ -378,6 +397,11 @@ For example the following will list all the tests that have a ``maintenance`` ta
378397
Similarly to the ``-p`` option, you can chain multiple ``-t`` options together, in which case a regression test will be selected if it is associated with all the tags specified in the command line.
379398
The list of tags associated with a check can be viewed in the listing output when specifying the ``-l`` option.
380399

400+
.. note::
401+
.. versionadded:: 2.17
402+
403+
The ``-t`` option recognizes regular expressions as arguments.
404+
381405
Selecting tests by name
382406
^^^^^^^^^^^^^^^^^^^^^^^
383407

@@ -439,6 +463,18 @@ Similarly, you can exclude this test by passing the ``-x Example7Test`` option:
439463
Found 12 check(s).
440464
441465
466+
Both ``-n`` and ``-x`` options can be chained, in which case either the tests that have any of the specified names are selected or excluded from running.
467+
They may also accept regular expressions as arguments.
468+
469+
.. note::
470+
.. versionadded:: 2.17
471+
472+
The ``-n`` and ``-x`` options recognize regular expressions as arguments.
473+
Chaining these options, e.g., ``-n A -n B``, is equivalent to a regular expression that applies OR to the individual arguments, i.e., equivalent to ``-n 'A|B'``.
474+
475+
476+
477+
442478
Controlling the Execution of Regression Tests
443479
---------------------------------------------
444480

0 commit comments

Comments
 (0)