mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Implement PlatformIO CLI 2.0 // Resolve #158
This commit is contained in:
@ -4,6 +4,9 @@ Release History
|
|||||||
2.0.0 (2015-??-??)
|
2.0.0 (2015-??-??)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
* Implemented PlatformIO CLI 2.0: "platform" related commands have been
|
||||||
|
moved to ``platformio platforms`` subcommand
|
||||||
|
(`issue #158 <https://github.com/platformio/platformio/issues/158>`_)
|
||||||
* Added global ``-f, --force`` option which will force to accept any
|
* Added global ``-f, --force`` option which will force to accept any
|
||||||
confirmation prompts (`issue #152 <https://github.com/platformio/platformio/issues/152>`_)
|
confirmation prompts (`issue #152 <https://github.com/platformio/platformio/issues/152>`_)
|
||||||
* Allowed to choose which library to update
|
* Allowed to choose which library to update
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
VERSION = (2, 0, "0.dev0")
|
VERSION = (2, 0, "0.dev1")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
|
||||||
# See LICENSE for details.
|
|
||||||
|
|
||||||
import click
|
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
|
||||||
|
|
||||||
|
|
||||||
@click.command("install", short_help="Install new platforms")
|
|
||||||
@click.argument("platforms", nargs=-1)
|
|
||||||
@click.option("--with-package", multiple=True, metavar="<package>")
|
|
||||||
@click.option("--without-package", multiple=True, metavar="<package>")
|
|
||||||
@click.option("--skip-default-package", is_flag=True)
|
|
||||||
def cli(platforms, with_package, without_package, skip_default_package):
|
|
||||||
|
|
||||||
for platform in platforms:
|
|
||||||
p = PlatformFactory.newPlatform(platform)
|
|
||||||
if p.install(with_package, without_package, skip_default_package):
|
|
||||||
click.secho("The platform '%s' has been successfully installed!" %
|
|
||||||
platform, fg="green")
|
|
@ -1,34 +0,0 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
|
||||||
# See LICENSE for details.
|
|
||||||
|
|
||||||
import json
|
|
||||||
|
|
||||||
import click
|
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
|
||||||
|
|
||||||
|
|
||||||
@click.command("list", short_help="List installed platforms")
|
|
||||||
@click.option("--json-output", is_flag=True)
|
|
||||||
def cli(json_output):
|
|
||||||
|
|
||||||
installed_platforms = PlatformFactory.get_platforms(
|
|
||||||
installed=True).keys()
|
|
||||||
installed_platforms.sort()
|
|
||||||
|
|
||||||
data = []
|
|
||||||
for platform in installed_platforms:
|
|
||||||
p = PlatformFactory.newPlatform(platform)
|
|
||||||
data.append({
|
|
||||||
"name": platform,
|
|
||||||
"packages": p.get_installed_packages()
|
|
||||||
})
|
|
||||||
|
|
||||||
if json_output:
|
|
||||||
click.echo(json.dumps(data))
|
|
||||||
else:
|
|
||||||
for item in data:
|
|
||||||
click.echo("{name:<20} with packages: {pkgs}".format(
|
|
||||||
name=click.style(item['name'], fg="cyan"),
|
|
||||||
pkgs=", ".join(item['packages'])
|
|
||||||
))
|
|
154
platformio/commands/platforms.py
Normal file
154
platformio/commands/platforms.py
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
|
# See LICENSE for details.
|
||||||
|
|
||||||
|
import json
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
import click
|
||||||
|
|
||||||
|
from platformio import app
|
||||||
|
from platformio.exception import PlatformNotInstalledYet
|
||||||
|
from platformio.pkgmanager import PackageManager
|
||||||
|
from platformio.platforms.base import PlatformFactory
|
||||||
|
|
||||||
|
|
||||||
|
@click.group(short_help="Platforms and Packages Manager")
|
||||||
|
def cli():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command("install", short_help="Install new platforms")
|
||||||
|
@click.argument("platforms", nargs=-1)
|
||||||
|
@click.option("--with-package", multiple=True, metavar="<package>")
|
||||||
|
@click.option("--without-package", multiple=True, metavar="<package>")
|
||||||
|
@click.option("--skip-default-package", is_flag=True)
|
||||||
|
def platforms_install(platforms, with_package, without_package,
|
||||||
|
skip_default_package):
|
||||||
|
for platform in platforms:
|
||||||
|
p = PlatformFactory.newPlatform(platform)
|
||||||
|
if p.install(with_package, without_package, skip_default_package):
|
||||||
|
click.secho("The platform '%s' has been successfully installed!" %
|
||||||
|
platform, fg="green")
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command("list", short_help="List installed platforms")
|
||||||
|
@click.option("--json-output", is_flag=True)
|
||||||
|
def platforms_list(json_output):
|
||||||
|
|
||||||
|
installed_platforms = PlatformFactory.get_platforms(
|
||||||
|
installed=True).keys()
|
||||||
|
installed_platforms.sort()
|
||||||
|
|
||||||
|
data = []
|
||||||
|
for platform in installed_platforms:
|
||||||
|
p = PlatformFactory.newPlatform(platform)
|
||||||
|
data.append({
|
||||||
|
"name": platform,
|
||||||
|
"packages": p.get_installed_packages()
|
||||||
|
})
|
||||||
|
|
||||||
|
if json_output:
|
||||||
|
click.echo(json.dumps(data))
|
||||||
|
else:
|
||||||
|
for item in data:
|
||||||
|
click.echo("{name:<20} with packages: {pkgs}".format(
|
||||||
|
name=click.style(item['name'], fg="cyan"),
|
||||||
|
pkgs=", ".join(item['packages'])
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command("search", short_help="Search for development platforms")
|
||||||
|
@click.argument("query", required=False)
|
||||||
|
@click.option("--json-output", is_flag=True)
|
||||||
|
def platforms_search(query, json_output):
|
||||||
|
|
||||||
|
data = []
|
||||||
|
platforms = PlatformFactory.get_platforms().keys()
|
||||||
|
platforms.sort()
|
||||||
|
for platform in platforms:
|
||||||
|
p = PlatformFactory.newPlatform(platform)
|
||||||
|
type_ = p.get_type()
|
||||||
|
description = p.get_description()
|
||||||
|
|
||||||
|
if query == "all":
|
||||||
|
query = ""
|
||||||
|
|
||||||
|
search_data = "%s %s %s" % (type_, description, p.get_packages())
|
||||||
|
if query and query.lower() not in search_data.lower():
|
||||||
|
continue
|
||||||
|
|
||||||
|
data.append({
|
||||||
|
"type": type_,
|
||||||
|
"description": description,
|
||||||
|
"packages": p.get_packages()
|
||||||
|
})
|
||||||
|
|
||||||
|
if json_output:
|
||||||
|
click.echo(json.dumps(data))
|
||||||
|
else:
|
||||||
|
for item in data:
|
||||||
|
click.secho(item['type'], fg="cyan", nl=False)
|
||||||
|
click.echo(" (available packages: %s)" % ", ".join(
|
||||||
|
p.get_packages().keys()))
|
||||||
|
click.secho("-" * len(item['type']), fg="cyan")
|
||||||
|
click.echo(item['description'])
|
||||||
|
click.echo()
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command("show", short_help="Show details about installed platform")
|
||||||
|
@click.argument("platform")
|
||||||
|
@click.pass_context
|
||||||
|
def platforms_show(ctx, platform):
|
||||||
|
|
||||||
|
installed_platforms = PlatformFactory.get_platforms(
|
||||||
|
installed=True).keys()
|
||||||
|
|
||||||
|
if platform not in installed_platforms:
|
||||||
|
if (not app.get_setting("enable_prompts") or
|
||||||
|
click.confirm("The platform '%s' has not been installed yet. "
|
||||||
|
"Would you like to install it now?" % platform)):
|
||||||
|
ctx.invoke(platforms_install, platforms=[platform])
|
||||||
|
else:
|
||||||
|
raise PlatformNotInstalledYet(platform)
|
||||||
|
|
||||||
|
p = PlatformFactory.newPlatform(platform)
|
||||||
|
click.echo("{name:<20} - {description} [ {url} ]".format(
|
||||||
|
name=click.style(p.get_type(), fg="cyan"),
|
||||||
|
description=p.get_description(), url=p.get_vendor_url()))
|
||||||
|
|
||||||
|
installed_packages = PackageManager.get_installed()
|
||||||
|
for name in p.get_installed_packages():
|
||||||
|
data = installed_packages[name]
|
||||||
|
pkgalias = p.get_pkg_alias(name)
|
||||||
|
click.echo("----------")
|
||||||
|
click.echo("Package: %s" % click.style(name, fg="yellow"))
|
||||||
|
if pkgalias:
|
||||||
|
click.echo("Alias: %s" % pkgalias)
|
||||||
|
click.echo("Version: %d" % int(data['version']))
|
||||||
|
click.echo("Installed: %s" % datetime.fromtimestamp(
|
||||||
|
data['time']).strftime("%Y-%m-%d %H:%M:%S"))
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command("uninstall", short_help="Uninstall platforms")
|
||||||
|
@click.argument("platforms", nargs=-1)
|
||||||
|
def platforms_uninstall(platforms):
|
||||||
|
|
||||||
|
for platform in platforms:
|
||||||
|
p = PlatformFactory.newPlatform(platform)
|
||||||
|
if p.uninstall():
|
||||||
|
click.secho("The platform '%s' has been successfully "
|
||||||
|
"uninstalled!" % platform, fg="green")
|
||||||
|
|
||||||
|
|
||||||
|
@cli.command("update", short_help="Update installed Platforms and Packages")
|
||||||
|
def platforms_update():
|
||||||
|
|
||||||
|
installed_platforms = PlatformFactory.get_platforms(
|
||||||
|
installed=True).keys()
|
||||||
|
installed_platforms.sort()
|
||||||
|
|
||||||
|
for platform in installed_platforms:
|
||||||
|
click.echo("\nPlatform %s" % click.style(platform, fg="cyan"))
|
||||||
|
click.echo("--------")
|
||||||
|
p = PlatformFactory.newPlatform(platform)
|
||||||
|
p.update()
|
@ -9,7 +9,8 @@ from time import time
|
|||||||
import click
|
import click
|
||||||
|
|
||||||
from platformio import app, exception, telemetry, util
|
from platformio import app, exception, telemetry, util
|
||||||
from platformio.commands.install import cli as cmd_install
|
from platformio.commands.platforms import \
|
||||||
|
platforms_install as cmd_platforms_install
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
|
|
||||||
|
|
||||||
@ -120,7 +121,7 @@ def _run_environment(ctx, name, options, targets, upload_port):
|
|||||||
not app.get_setting("enable_prompts") or
|
not app.get_setting("enable_prompts") or
|
||||||
click.confirm("The platform '%s' has not been installed yet. "
|
click.confirm("The platform '%s' has not been installed yet. "
|
||||||
"Would you like to install it now?" % platform))):
|
"Would you like to install it now?" % platform))):
|
||||||
ctx.invoke(cmd_install, platforms=[platform])
|
ctx.invoke(cmd_platforms_install, platforms=[platform])
|
||||||
|
|
||||||
p = PlatformFactory.newPlatform(platform)
|
p = PlatformFactory.newPlatform(platform)
|
||||||
return p.run(variables, envtargets)
|
return p.run(variables, envtargets)
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
|
||||||
# See LICENSE for details.
|
|
||||||
|
|
||||||
import json
|
|
||||||
|
|
||||||
import click
|
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
|
||||||
|
|
||||||
|
|
||||||
@click.command("search", short_help="Search for development platforms")
|
|
||||||
@click.argument("query", required=False)
|
|
||||||
@click.option("--json-output", is_flag=True)
|
|
||||||
def cli(query, json_output):
|
|
||||||
|
|
||||||
data = []
|
|
||||||
platforms = PlatformFactory.get_platforms().keys()
|
|
||||||
platforms.sort()
|
|
||||||
for platform in platforms:
|
|
||||||
p = PlatformFactory.newPlatform(platform)
|
|
||||||
type_ = p.get_type()
|
|
||||||
description = p.get_description()
|
|
||||||
|
|
||||||
if query == "all":
|
|
||||||
query = ""
|
|
||||||
|
|
||||||
search_data = "%s %s %s" % (type_, description, p.get_packages())
|
|
||||||
if query and query.lower() not in search_data.lower():
|
|
||||||
continue
|
|
||||||
|
|
||||||
data.append({
|
|
||||||
"type": type_,
|
|
||||||
"description": description,
|
|
||||||
"packages": p.get_packages()
|
|
||||||
})
|
|
||||||
|
|
||||||
if json_output:
|
|
||||||
click.echo(json.dumps(data))
|
|
||||||
else:
|
|
||||||
for item in data:
|
|
||||||
click.secho(item['type'], fg="cyan", nl=False)
|
|
||||||
click.echo(" (available packages: %s)" % ", ".join(
|
|
||||||
p.get_packages().keys()))
|
|
||||||
click.secho("-" * len(item['type']), fg="cyan")
|
|
||||||
click.echo(item['description'])
|
|
||||||
click.echo()
|
|
@ -1,46 +0,0 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
|
||||||
# See LICENSE for details.
|
|
||||||
|
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
import click
|
|
||||||
|
|
||||||
from platformio import app
|
|
||||||
from platformio.commands.install import cli as cmd_install
|
|
||||||
from platformio.exception import PlatformNotInstalledYet
|
|
||||||
from platformio.pkgmanager import PackageManager
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
|
||||||
|
|
||||||
|
|
||||||
@click.command("show", short_help="Show details about installed platform")
|
|
||||||
@click.argument("platform")
|
|
||||||
@click.pass_context
|
|
||||||
def cli(ctx, platform):
|
|
||||||
|
|
||||||
installed_platforms = PlatformFactory.get_platforms(
|
|
||||||
installed=True).keys()
|
|
||||||
|
|
||||||
if platform not in installed_platforms:
|
|
||||||
if (not app.get_setting("enable_prompts") or
|
|
||||||
click.confirm("The platform '%s' has not been installed yet. "
|
|
||||||
"Would you like to install it now?" % platform)):
|
|
||||||
ctx.invoke(cmd_install, platforms=[platform])
|
|
||||||
else:
|
|
||||||
raise PlatformNotInstalledYet(platform)
|
|
||||||
|
|
||||||
p = PlatformFactory.newPlatform(platform)
|
|
||||||
click.echo("{name:<20} - {description} [ {url} ]".format(
|
|
||||||
name=click.style(p.get_type(), fg="cyan"),
|
|
||||||
description=p.get_description(), url=p.get_vendor_url()))
|
|
||||||
|
|
||||||
installed_packages = PackageManager.get_installed()
|
|
||||||
for name in p.get_installed_packages():
|
|
||||||
data = installed_packages[name]
|
|
||||||
pkgalias = p.get_pkg_alias(name)
|
|
||||||
click.echo("----------")
|
|
||||||
click.echo("Package: %s" % click.style(name, fg="yellow"))
|
|
||||||
if pkgalias:
|
|
||||||
click.echo("Alias: %s" % pkgalias)
|
|
||||||
click.echo("Version: %d" % int(data['version']))
|
|
||||||
click.echo("Installed: %s" % datetime.fromtimestamp(
|
|
||||||
data['time']).strftime("%Y-%m-%d %H:%M:%S"))
|
|
@ -1,17 +0,0 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
|
||||||
# See LICENSE for details.
|
|
||||||
|
|
||||||
import click
|
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
|
||||||
|
|
||||||
|
|
||||||
@click.command("uninstall", short_help="Uninstall platforms")
|
|
||||||
@click.argument("platforms", nargs=-1)
|
|
||||||
def cli(platforms):
|
|
||||||
|
|
||||||
for platform in platforms:
|
|
||||||
p = PlatformFactory.newPlatform(platform)
|
|
||||||
if p.uninstall():
|
|
||||||
click.secho("The platform '%s' has been successfully "
|
|
||||||
"uninstalled!" % platform, fg="green")
|
|
@ -3,18 +3,14 @@
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.commands.lib import lib_update as cmd_lib_update
|
||||||
|
from platformio.commands.platforms import \
|
||||||
|
platforms_update as cmd_platforms_update
|
||||||
|
|
||||||
|
|
||||||
@click.command("update", short_help="Update installed platforms")
|
@click.command("update",
|
||||||
def cli():
|
short_help="Update installed Platforms, Packages and Libraries")
|
||||||
|
@click.pass_context
|
||||||
installed_platforms = PlatformFactory.get_platforms(
|
def cli(ctx):
|
||||||
installed=True).keys()
|
ctx.invoke(cmd_platforms_update)
|
||||||
installed_platforms.sort()
|
ctx.invoke(cmd_lib_update)
|
||||||
|
|
||||||
for platform in installed_platforms:
|
|
||||||
click.echo("\nPlatform %s" % click.style(platform, fg="cyan"))
|
|
||||||
click.echo("--------")
|
|
||||||
p = PlatformFactory.newPlatform(platform)
|
|
||||||
p.update()
|
|
||||||
|
@ -11,9 +11,11 @@ from time import time
|
|||||||
import click
|
import click
|
||||||
|
|
||||||
from platformio import __version__, app, exception, telemetry
|
from platformio import __version__, app, exception, telemetry
|
||||||
from platformio.commands.install import cli as cmd_install
|
|
||||||
from platformio.commands.lib import lib_update as cmd_libraries_update
|
from platformio.commands.lib import lib_update as cmd_libraries_update
|
||||||
from platformio.commands.update import cli as cli_update
|
from platformio.commands.platforms import \
|
||||||
|
platforms_install as cmd_platforms_install
|
||||||
|
from platformio.commands.platforms import \
|
||||||
|
platforms_update as cmd_platforms_update
|
||||||
from platformio.commands.upgrade import get_latest_version
|
from platformio.commands.upgrade import get_latest_version
|
||||||
from platformio.libmanager import LibraryManager
|
from platformio.libmanager import LibraryManager
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
@ -90,7 +92,7 @@ class Upgrader(object):
|
|||||||
remove(join(get_home_dir(), fname))
|
remove(join(get_home_dir(), fname))
|
||||||
|
|
||||||
if prev_platforms:
|
if prev_platforms:
|
||||||
ctx.invoke(cmd_install, platforms=prev_platforms)
|
ctx.invoke(cmd_platforms_install, platforms=prev_platforms)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -98,8 +100,7 @@ class Upgrader(object):
|
|||||||
installed_platforms = PlatformFactory.get_platforms(
|
installed_platforms = PlatformFactory.get_platforms(
|
||||||
installed=True).keys()
|
installed=True).keys()
|
||||||
if installed_platforms:
|
if installed_platforms:
|
||||||
ctx.invoke(cmd_install, platforms=installed_platforms)
|
ctx.invoke(cmd_platforms_install, platforms=installed_platforms)
|
||||||
ctx.invoke(cli_update)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@ -134,6 +135,8 @@ def after_upgrade(ctx):
|
|||||||
u = Upgrader(last_version, __version__)
|
u = Upgrader(last_version, __version__)
|
||||||
if u.run(ctx):
|
if u.run(ctx):
|
||||||
app.set_state_item("last_version", __version__)
|
app.set_state_item("last_version", __version__)
|
||||||
|
ctx.invoke(cmd_platforms_update)
|
||||||
|
|
||||||
click.secho("PlatformIO has been successfully upgraded to %s!\n" %
|
click.secho("PlatformIO has been successfully upgraded to %s!\n" %
|
||||||
__version__, fg="green")
|
__version__, fg="green")
|
||||||
|
|
||||||
@ -195,14 +198,14 @@ def check_internal_updates(ctx, what):
|
|||||||
|
|
||||||
if not app.get_setting("auto_update_" + what):
|
if not app.get_setting("auto_update_" + what):
|
||||||
click.secho("Please update them via ", fg="yellow", nl=False)
|
click.secho("Please update them via ", fg="yellow", nl=False)
|
||||||
click.secho("`platformio %supdate`" %
|
click.secho("`platformio %s update`" %
|
||||||
("lib " if what == "libraries" else ""),
|
("lib" if what == "libraries" else "platforms"),
|
||||||
fg="cyan", nl=False)
|
fg="cyan", nl=False)
|
||||||
click.secho(" command.\n", fg="yellow")
|
click.secho(" command.\n", fg="yellow")
|
||||||
else:
|
else:
|
||||||
click.secho("Please wait while updating %s ..." % what, fg="yellow")
|
click.secho("Please wait while updating %s ..." % what, fg="yellow")
|
||||||
if what == "platforms":
|
if what == "platforms":
|
||||||
ctx.invoke(cli_update)
|
ctx.invoke(cmd_platforms_update)
|
||||||
elif what == "libraries":
|
elif what == "libraries":
|
||||||
ctx.invoke(cmd_libraries_update)
|
ctx.invoke(cmd_libraries_update)
|
||||||
click.echo()
|
click.echo()
|
||||||
|
@ -5,13 +5,15 @@ import json
|
|||||||
from os.path import isfile, join
|
from os.path import isfile, join
|
||||||
|
|
||||||
from platformio import util
|
from platformio import util
|
||||||
from platformio.commands.boards import cli as boards_cli
|
from platformio.commands.boards import cli as cmd_boards
|
||||||
from platformio.commands.install import cli as install_cli
|
from platformio.commands.platforms import \
|
||||||
from platformio.commands.search import cli as search_cli
|
platforms_install as cmd_platforms_install
|
||||||
|
from platformio.commands.platforms import \
|
||||||
|
platforms_search as cmd_platforms_search
|
||||||
|
|
||||||
|
|
||||||
def test_board_json_output(platformio_setup, clirunner, validate_cliresult):
|
def test_board_json_output(platformio_setup, clirunner, validate_cliresult):
|
||||||
result = clirunner.invoke(boards_cli, ["cortex", "--json-output"])
|
result = clirunner.invoke(cmd_boards, ["cortex", "--json-output"])
|
||||||
validate_cliresult(result)
|
validate_cliresult(result)
|
||||||
boards = json.loads(result.output)
|
boards = json.loads(result.output)
|
||||||
assert isinstance(boards, dict)
|
assert isinstance(boards, dict)
|
||||||
@ -19,7 +21,7 @@ def test_board_json_output(platformio_setup, clirunner, validate_cliresult):
|
|||||||
|
|
||||||
|
|
||||||
def test_board_raw_output(platformio_setup, clirunner, validate_cliresult):
|
def test_board_raw_output(platformio_setup, clirunner, validate_cliresult):
|
||||||
result = clirunner.invoke(boards_cli, ["energia"])
|
result = clirunner.invoke(cmd_boards, ["energia"])
|
||||||
validate_cliresult(result)
|
validate_cliresult(result)
|
||||||
assert "titiva" in result.output
|
assert "titiva" in result.output
|
||||||
|
|
||||||
@ -29,7 +31,7 @@ def test_board_options(platformio_setup, clirunner, validate_cliresult):
|
|||||||
["build", "platform", "upload", "name"])
|
["build", "platform", "upload", "name"])
|
||||||
|
|
||||||
# fetch available platforms
|
# fetch available platforms
|
||||||
result = clirunner.invoke(search_cli, ["--json-output"])
|
result = clirunner.invoke(cmd_platforms_search, ["--json-output"])
|
||||||
validate_cliresult(result)
|
validate_cliresult(result)
|
||||||
search_result = json.loads(result.output)
|
search_result = json.loads(result.output)
|
||||||
assert isinstance(search_result, list)
|
assert isinstance(search_result, list)
|
||||||
@ -43,7 +45,7 @@ def test_board_options(platformio_setup, clirunner, validate_cliresult):
|
|||||||
|
|
||||||
def test_board_ldscripts(platformio_setup, clirunner, validate_cliresult):
|
def test_board_ldscripts(platformio_setup, clirunner, validate_cliresult):
|
||||||
result = clirunner.invoke(
|
result = clirunner.invoke(
|
||||||
install_cli, [
|
cmd_platforms_install, [
|
||||||
"ststm32",
|
"ststm32",
|
||||||
"--skip-default-package",
|
"--skip-default-package",
|
||||||
"--with-package=ldscripts"
|
"--with-package=ldscripts"
|
||||||
|
Reference in New Issue
Block a user