mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Rename test --ignore option to --skip
This commit is contained in:
@ -43,9 +43,9 @@ Options
|
|||||||
Process specified environments. More details :option:`platformio run --environment`
|
Process specified environments. More details :option:`platformio run --environment`
|
||||||
|
|
||||||
.. option::
|
.. option::
|
||||||
-i, --ignore
|
--skip
|
||||||
|
|
||||||
Ignore tests where the name matches with specified pattern. More than one
|
Skip over tests where the name matches specified patterns. More than one
|
||||||
option/pattern is allowed.
|
option/pattern is allowed.
|
||||||
|
|
||||||
.. list-table::
|
.. list-table::
|
||||||
@ -66,7 +66,7 @@ option/pattern is allowed.
|
|||||||
* - ``[!seq]``
|
* - ``[!seq]``
|
||||||
- matches any character not in seq
|
- matches any character not in seq
|
||||||
|
|
||||||
For example, ``platformio test --ignore "mytest*" -i "test[13]"``
|
For example, ``platformio test --skip "mytest*" -i "test[13]"``
|
||||||
|
|
||||||
.. option::
|
.. option::
|
||||||
--upload-port
|
--upload-port
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
# pylint: disable=R0913,R0914
|
||||||
|
|
||||||
from fnmatch import fnmatch
|
from fnmatch import fnmatch
|
||||||
from os import getcwd, listdir
|
from os import getcwd, listdir
|
||||||
from os.path import isdir, join
|
from os.path import isdir, join
|
||||||
@ -28,15 +30,14 @@ from platformio.managers.platform import PlatformFactory
|
|||||||
|
|
||||||
@click.command("test", short_help="Unit Testing")
|
@click.command("test", short_help="Unit Testing")
|
||||||
@click.option("--environment", "-e", multiple=True, metavar="<environment>")
|
@click.option("--environment", "-e", multiple=True, metavar="<environment>")
|
||||||
@click.option("--ignore", "-i", multiple=True, metavar="<pattern>")
|
@click.option("--skip", multiple=True, metavar="<pattern>")
|
||||||
@click.option("--upload-port", metavar="<upload port>")
|
@click.option("--upload-port", metavar="<upload port>")
|
||||||
@click.option("--project-dir", "-d", default=getcwd,
|
@click.option("--project-dir", "-d", default=getcwd,
|
||||||
type=click.Path(exists=True, file_okay=False, dir_okay=True,
|
type=click.Path(exists=True, file_okay=False, dir_okay=True,
|
||||||
writable=True, resolve_path=True))
|
writable=True, resolve_path=True))
|
||||||
@click.option("--verbose", "-v", count=True, default=3)
|
@click.option("--verbose", "-v", count=True, default=3)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def cli(ctx, environment, ignore, upload_port, # pylint: disable=R0913,R0914
|
def cli(ctx, environment, skip, upload_port, project_dir, verbose):
|
||||||
project_dir, verbose):
|
|
||||||
assert check_project_envs(project_dir, environment)
|
assert check_project_envs(project_dir, environment)
|
||||||
with util.cd(project_dir):
|
with util.cd(project_dir):
|
||||||
test_dir = util.get_projecttest_dir()
|
test_dir = util.get_projecttest_dir()
|
||||||
@ -58,8 +59,8 @@ def cli(ctx, environment, ignore, upload_port, # pylint: disable=R0913,R0914
|
|||||||
if environment and envname not in environment:
|
if environment and envname not in environment:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# check ignore patterns
|
# check skip patterns
|
||||||
if testname != "*" and any([fnmatch(testname, i) for i in ignore]):
|
if testname != "*" and any([fnmatch(testname, p) for p in skip]):
|
||||||
results.append((None, testname, envname))
|
results.append((None, testname, envname))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -133,7 +134,8 @@ class TestProcessor(object):
|
|||||||
return self.cmd_ctx.invoke(
|
return self.cmd_ctx.invoke(
|
||||||
cmd_run, project_dir=self.options['project_dir'],
|
cmd_run, project_dir=self.options['project_dir'],
|
||||||
upload_port=self.options['upload_port'],
|
upload_port=self.options['upload_port'],
|
||||||
verbose=self.options['verbose'], environment=[self.env_name],
|
verbose=self.options['verbose'],
|
||||||
|
environment=[self.env_name],
|
||||||
target=target
|
target=target
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user