From 0c06982d756465f275c80bb3a045ee206940ef84 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 24 Jun 2017 18:40:30 +0300 Subject: [PATCH] =?UTF-8?q?Filter=20PIO=20Unit=20Testing=20tests=20using?= =?UTF-8?q?=20a=20new=20test=5Ffilter=20option=20in=20"platformio.ini"=20o?= =?UTF-8?q?r=20`platformio=20test=20=E2=80=93filter`=20command=20//=20Reso?= =?UTF-8?q?lve=20#934?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY.rst | 4 ++++ docs | 2 +- platformio/commands/run.py | 9 +++++---- platformio/commands/test.py | 13 ++++++++++++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 45f024b5..fb34f947 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,10 @@ PlatformIO 3.0 - Built-in into `PlatformIO IDE for Atom `__ and `PlatformIO IDE for VScode `__ - Integration with `Eclipse `__ and `Sublime Text `__ +* Filter `PIO Unit Testing `__ + tests using a new ``test_filter`` option in `Project Configuration File "platformio.ini" `__ + or `platformio test --filter `__ command + (`issue #934 `_) * Custom ``test_transport`` for `PIO Unit Testing `__ Engine * Configure Serial Port Monitor in `Project Configuration File "platformio.ini" `__ (`issue #787 `_) diff --git a/docs b/docs index d242df40..ffee09c3 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit d242df40dbb96bfe86dfacba43d7ba1782e2b15e +Subproject commit ffee09c3508d2fc6c1feac721662ebf106ba03cb diff --git a/platformio/commands/run.py b/platformio/commands/run.py index e6158e7d..403a0a15 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -134,10 +134,11 @@ class EnvironmentProcessor(object): "debug_extra_cmds", "debug_server", "debug_init_break", "debug_load_cmd") - IGNORE_BUILD_OPTIONS = ("test_transport", "test_ignore", "test_port", - "debug_tool", "debug_port", "debug_init_cmds", - "debug_extra_cmds", "debug_server", - "debug_init_break", "debug_load_cmd") + IGNORE_BUILD_OPTIONS = ("test_transport", "test_filter", "test_ignore", + "test_port", "debug_tool", "debug_port", + "debug_init_cmds", "debug_extra_cmds", + "debug_server", "debug_init_break", + "debug_load_cmd") REMAPED_OPTIONS = {"framework": "pioframework", "platform": "pioplatform"} diff --git a/platformio/commands/test.py b/platformio/commands/test.py index 30a5de6c..4c6414c9 100644 --- a/platformio/commands/test.py +++ b/platformio/commands/test.py @@ -22,7 +22,18 @@ from platformio.managers.core import pioplus_call @click.command("test", short_help="Local Unit Testing") @click.option("--environment", "-e", multiple=True, metavar="") -@click.option("--ignore", "-i", multiple=True, metavar="") +@click.option( + "--filter", + "-f", + multiple=True, + metavar="", + help="Filter tests by a pattern") +@click.option( + "--ignore", + "-i", + multiple=True, + metavar="", + help="Ignore tests by a pattern") @click.option("--upload-port") @click.option("--test-port") @click.option(