Custom transport for Unit Testing

This commit is contained in:
Ivan Kravets
2017-06-20 18:48:52 +03:00
parent 6ad1ce5239
commit f78837d467
4 changed files with 42 additions and 42 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ def _get_installed_platform_data(platform,
name=p.name,
title=p.title,
description=p.description,
version=p.version, # comment before dump
version=p.version,
homepage=p.homepage,
repository=p.repository_url,
url=p.vendor_url,
+23 -24
View File
@@ -122,18 +122,19 @@ def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
class EnvironmentProcessor(object):
KNOWN_OPTIONS = ("platform", "framework", "board", "board_mcu",
"board_f_cpu", "board_f_flash", "board_flash_mode",
"build_flags", "src_build_flags", "build_unflags",
"src_filter", "extra_script", "targets", "upload_port",
"upload_protocol", "upload_speed", "upload_flags",
"upload_resetmethod", "lib_deps", "lib_ignore",
"lib_extra_dirs", "lib_ldf_mode", "lib_compat_mode",
"piotest", "test_ignore", "test_port", "debug_tool",
"debug_port", "debug_init_cmds", "debug_extra_cmds",
"debug_server", "debug_init_break", "debug_load_cmd")
KNOWN_OPTIONS = (
"platform", "framework", "board", "board_mcu", "board_f_cpu",
"board_f_flash", "board_flash_mode", "build_flags", "src_build_flags",
"build_unflags", "src_filter", "extra_script", "targets",
"upload_port", "upload_protocol", "upload_speed", "upload_flags",
"upload_resetmethod", "lib_deps", "lib_ignore", "lib_extra_dirs",
"lib_ldf_mode", "lib_compat_mode", "piotest", "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 = ("debug_tool", "debug_port", "debug_init_cmds",
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")
@@ -168,13 +169,12 @@ class EnvironmentProcessor(object):
self.options[k] = self.options[k].strip()
if not self.silent:
click.echo("[%s] Processing %s (%s)" %
(datetime.now().strftime("%c"),
click.style(self.name, fg="cyan", bold=True),
"; ".join([
"%s: %s" % (k, v.replace("\n", ", "))
for k, v in self.options.items()
])))
click.echo("[%s] Processing %s (%s)" % (
datetime.now().strftime("%c"),
click.style(self.name, fg="cyan", bold=True), "; ".join([
"%s: %s" % (k, v.replace("\n", ", "))
for k, v in self.options.items()
])))
click.secho("-" * terminal_width, bold=True)
self.options = self._validate_options(self.options)
@@ -217,8 +217,8 @@ class EnvironmentProcessor(object):
# warn about unknown options
if k not in self.KNOWN_OPTIONS:
click.secho(
"Detected non-PlatformIO `%s` option in `[env:]` section" %
k,
"Detected non-PlatformIO `%s` option in `[env:%s]` section"
% (k, self.name),
fg="yellow")
result[k] = v
return result
@@ -357,10 +357,9 @@ def print_summary(results, start_time):
err=status is False)
print_header(
"[%s] Took %.2f seconds" %
((click.style("SUCCESS", fg="green", bold=True)
if successed else click.style("ERROR", fg="red", bold=True)),
time() - start_time),
"[%s] Took %.2f seconds" % (
(click.style("SUCCESS", fg="green", bold=True) if successed else
click.style("ERROR", fg="red", bold=True)), time() - start_time),
is_error=not successed)