Skip to content

Commit

Permalink
Merged the Unit Testing “building” stage with “uploading” for the emb…
Browse files Browse the repository at this point in the history
…edded target // Resolve #4307
  • Loading branch information
ivankravets committed Jun 12, 2022
1 parent 375c396 commit 4b5bc91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ PlatformIO Core 6
- Added new `pio device monitor --no-reconnect <https://docs.platformio.org/en/latest/core/userguide/device/cmd_monitor.html#cmdoption-pio-device-monitor-no-reconnect>`__ option to disable automatic reconnection
- Handle disconnects more gracefully (`issue #3939 <https://github.com/platformio/platformio-core/issues/3939>`_)

* Merged the |UNITTESTING| "building" stage with "uploading" for the embedded target (`issue #4307 <https://github.com/platformio/platformio-core/issues/4307>`_)
* Fixed an issue when a custom `pio test --project-config <https://docs.platformio.org/en/latest/core/userguide/cmd_test.html#cmdoption-pio-test-c>`__ was not handled properly (`issue #4299 <https://github.com/platformio/platformio-core/issues/4299>`_)

6.0.2 (2022-06-01)
Expand Down
10 changes: 8 additions & 2 deletions platformio/test/runners/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def setup(self):
def stage_building(self):
if self.options.without_building:
return None
# run "building" once at the "uploading" stage for the embedded target
if not self.options.without_uploading and self.platform.is_embedded():
return None
click.secho("Building...", bold=True)
targets = ["__test"]
if not self.options.without_debugging:
Expand All @@ -132,9 +135,12 @@ def stage_building(self):
)

def stage_uploading(self):
if self.options.without_uploading or not self.platform.is_embedded():
is_embedded = self.platform.is_embedded()
if self.options.without_uploading or not is_embedded:
return None
click.secho("Uploading...", bold=True)
click.secho(
"Building & Uploading..." if is_embedded else "Uploading...", bold=True
)
targets = ["upload"]
if self.options.without_building:
targets.append("nobuild")
Expand Down

0 comments on commit 4b5bc91

Please sign in to comment.