diff --git a/docs/running.rst b/docs/running.rst index baed22bd1e..7858bdc476 100644 --- a/docs/running.rst +++ b/docs/running.rst @@ -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 @@ -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 ----------------------------- diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index cb8a9f1237..460362514d 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -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') @@ -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..." % diff --git a/unittests/test_cli.py b/unittests/test_cli.py index 65ad756883..f8949d76bf 100644 --- a/unittests/test_cli.py +++ b/unittests/test_cli.py @@ -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 = []