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
13 changes: 12 additions & 1 deletion docs/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ ReFrame the does not search recursively into directories specified with the ``-c

The ``-c`` option completely overrides the default path.
Currently, there is no option to prepend or append to the default regression path.
However, you can build your own check path by specifying multiple times the ``-c`` option.
However, you can build your own check path by specifying a colon separated list of paths to the ``-c`` option.
The ``-c``\ option accepts also regular files. This is very useful when you are implementing new regression tests, since it allows you to run only your test:

.. code-block:: bash
Expand All @@ -321,6 +321,17 @@ The ``-c``\ option accepts also regular files. This is very useful when you are

.. versionadded:: 2.12

.. warning::
Using the command line ``-c`` or ``--checkpath`` multiple times is not supported anymore and only the last option will be considered.
Multiple paths should be passed instead as a colon separated list:

.. code-block:: bash

./bin/reframe -c /path/to/my/first/test.py:/path/to/my/second/ -r


.. versionchanged:: 3.0


Filtering of Regression Tests
-----------------------------
Expand Down
7 changes: 4 additions & 3 deletions reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ def main():

# Check discovery options
locate_options.add_argument(
'-c', '--checkpath', action='append', metavar='DIR|FILE',
help='Search for checks in DIR or FILE')
'-c', '--checkpath', action='store', metavar='DIR|FILE',
help="Search for checks in DIR or FILE; multiple paths can be "
"separated with `:'")
locate_options.add_argument(
'-R', '--recursive', action='store_true',
help='Load checks recursively')
Expand Down Expand Up @@ -410,7 +411,7 @@ def main():
# Setup the check loader
if options.checkpath:
load_path = []
for d in options.checkpath:
for d in options.checkpath.split(':'):
d = os_ext.expandvars(d)
if not os.path.exists(d):
printer.warning("%s: path `%s' does not exist. Skipping..." %
Expand Down
9 changes: 9 additions & 0 deletions unittests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ def test_sanity_of_optconfig(self):
returncode, *_ = self._run_reframe()
self.assertEqual(0, returncode)

def test_checkpath_colon_separated(self):
self.action = 'list'
self.checkpath = ['unittests/resources/checks/hellocheck_make.py:'
'unittests/resources/checks/hellocheck.py']
returncode, stdout, _ = self._run_reframe()
num_checks = re.search(
r'Found (\d+) check', stdout, re.MULTILINE).group(1)
self.assertEqual(num_checks, '2')

def test_checkpath_recursion(self):
self.action = 'list'
self.checkpath = []
Expand Down