From f78837d46789dca1ec53c852c077112647e31b09 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Jun 2017 18:48:52 +0300 Subject: [PATCH] Custom transport for Unit Testing --- HISTORY.rst | 33 ++++++++++++----------- docs | 2 +- platformio/commands/platform.py | 2 +- platformio/commands/run.py | 47 ++++++++++++++++----------------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index beec09bb..ef7b9d69 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,6 +15,7 @@ PlatformIO 3.0 - Compatibility with the popular IDEs: Atom, VSCode, Eclipse, Sublime Text, etc - Windows, MacOS, Linux (+ARMv6-8) +* Custom ``test_transport`` for `PIO Unit Testing `__ Engine * Configure Serial Port Monitor in `Project Configuration File "platformio.ini" `__ (`issue #787 `_) * Project generator for `VIM `__ @@ -137,11 +138,11 @@ PlatformIO 3.0 command (`issue #430 `_) * List supported frameworks, SDKs with a new - `pio platform frameworks `__ command + `pio platform frameworks `__ command * Visual Studio Code extension for PlatformIO (`issue #619 `_) * Added new options ``--no-reset``, ``--monitor-rts`` and ``--monitor-dtr`` - to `pio test `__ + to `pio test `__ command (allows to avoid automatic board's auto-reset when gathering test results) * Added support for templated methods in ``*.ino to *.cpp`` converter (`pull #858 `_) @@ -279,7 +280,7 @@ PlatformIO 3.0 * Custom boards per project with ``boards_dir`` option in `Project Configuration File "platformio.ini" `__ (`issue #515 `_) -* Unix shell-style wildcards for `upload_port `_ +* Unix shell-style wildcards for `upload_port `_ (`issue #839 `_) * Refactored `Library Dependency Finder (LDF) `__ C/C++ Preprocessor for conditional syntax (``#ifdef``, ``#if``, ``#else``, @@ -406,7 +407,7 @@ PlatformIO 3.0 * Improved Project Generator when custom ``--project-option`` is passed to `platformio init `__ command -* Deprecated ``lib_force`` option, please use `lib_deps `__ instead +* Deprecated ``lib_force`` option, please use `lib_deps `__ instead * Return valid exit code from ``plaformio test`` command * Fixed Project Generator for CLion IDE using Windows OS (`issue #785 `_) @@ -484,7 +485,7 @@ PlatformIO 3.0 * Library Manager 3.0 - + Project dependencies per build environment using `lib_deps `__ option + + Project dependencies per build environment using `lib_deps `__ option (`issue #413 `_) + `Semantic Versioning `__ for library commands and dependencies @@ -508,10 +509,10 @@ PlatformIO 3.0 + Check library compatibility with project environment before building (`issue #415 `_) + Control Library Dependency Finder for compatibility using - `lib_compat_mode `__ + `lib_compat_mode `__ option + Custom library storages/directories with - `lib_extra_dirs `__ option + `lib_extra_dirs `__ option (`issue #537 `_) + Handle extra build flags, source filters and build script from `library.json `__ @@ -767,11 +768,11 @@ PlatformIO 2.0 `platformio lib search `__ command (`issue #604 `_) -* Allowed to specify default environments `env_default `__ +* Allowed to specify default environments `env_default `__ which should be processed by default with ``platformio run`` command (`issue #576 `_) * Allowed to unflag(remove) base/initial flags using - `build_unflags `__ + `build_unflags `__ option (`issue #559 `_) * Allowed multiple VID/PID pairs when detecting serial ports @@ -1219,12 +1220,12 @@ PlatformIO 2.0 ~~~~~~~~~~~~~~~~~~ * Allowed to exclude/include source files from build process using - `src_filter `__ + `src_filter `__ (`issue #240 `_) * Launch own extra script before firmware building/uploading processes (`issue #239 `_) * Specify own path to the linker script (ld) using - `build_flags `__ + `build_flags `__ option (`issue #233 `_) * Specify library compatibility with the all platforms/frameworks @@ -1328,11 +1329,11 @@ PlatformIO 2.0 (`issue #192 `_) * Control verbosity of `platformio run `_ command via ``-v/--verbose`` option * Add library dependencies for build environment using - `lib_install `_ + `lib_install `_ option in ``platformio.ini`` (`issue #134 `_) * Specify libraries which are compatible with build environment using - `lib_use `_ + `lib_use `_ option in ``platformio.ini`` (`issue #148 `_) * Add more boards to PlatformIO project with @@ -1468,7 +1469,7 @@ PlatformIO 1.0 development platform * Added `Project Configuration `__ - option named `envs_dir `__ + option named `envs_dir `__ * Disabled "prompts" automatically for *Continuous Integration* systems (`issue #103 `_) * Fixed firmware uploading for @@ -1512,7 +1513,7 @@ PlatformIO 1.0 `#48 `_, `#50 `_, `#55 `_) -* Added `src_dir `__ +* Added `src_dir `__ option to ``[platformio]`` section of `platformio.ini `__ which allows to redefine location to project's source directory @@ -1523,7 +1524,7 @@ PlatformIO 1.0 commands which allows to return the output in `JSON `_ format (`issue #42 `_) * Allowed to ignore some libs from *Library Dependency Finder* via - `lib_ignore `_ option + `lib_ignore `_ option * Improved `platformio run `__ command: asynchronous output for build process, timing and detailed information about environment configuration diff --git a/docs b/docs index 00924a1e..58f08332 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 00924a1ed8bfabbe48ce4445b5ccace19301e28e +Subproject commit 58f083325e3fcb84672ac2a0718220286cb87f67 diff --git a/platformio/commands/platform.py b/platformio/commands/platform.py index ed9e17f8..53cd7fa5 100644 --- a/platformio/commands/platform.py +++ b/platformio/commands/platform.py @@ -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, diff --git a/platformio/commands/run.py b/platformio/commands/run.py index 077460db..4a9d6cc8 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -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)