Refactor "test_ignore" to accepts test names separated with comma // Resolve #753

This commit is contained in:
Ivan Kravets
2016-08-21 19:32:11 +03:00
parent 0f7f301787
commit f5b4cb0ae8
2 changed files with 5 additions and 7 deletions

View File

@@ -802,9 +802,9 @@ Test options
.. seealso:: .. seealso::
Please make sure to read :ref:`unit_testing` guide first. Please make sure to read :ref:`unit_testing` guide first.
Ignore tests where the name matches specified patterns. Ignore tests where the name matches specified patterns. Multiple names are
More than one pattern is allowed (multi-lines). Also, you can ignore some allowed. Please separate them using comma ``,`` symbol. Also, you can
tests using :option:`platformio test --ignore` command. ignore some tests using :option:`platformio test --ignore` command.
.. list-table:: .. list-table::
:header-rows: 1 :header-rows: 1
@@ -829,9 +829,7 @@ tests using :option:`platformio test --ignore` command.
.. code-block:: ini .. code-block:: ini
[env:myenv] [env:myenv]
test_ignore = test_ignore = footest, bartest_*, test[13]
mytest*
test[13]
----------- -----------

View File

@@ -72,7 +72,7 @@ def cli(ctx, environment, ignore, upload_port, project_dir, verbose):
if projectconf.has_option(section, "test_ignore"): if projectconf.has_option(section, "test_ignore"):
_ignore.extend([p.strip() _ignore.extend([p.strip()
for p in projectconf.get( for p in projectconf.get(
section, "test_ignore").split("\n") section, "test_ignore").split(",")
if p.strip()]) if p.strip()])
if testname != "*" and \ if testname != "*" and \
any([fnmatch(testname, p) for p in _ignore]): any([fnmatch(testname, p) for p in _ignore]):