diff --git a/HISTORY.rst b/HISTORY.rst index d194ee84..2b2fa4cb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -22,6 +22,7 @@ PlatformIO Core 6 - Added new `pio device monitor --no-reconnect `__ option to disable automatic reconnection - Handle disconnects more gracefully (`issue #3939 `_) +* Merged the |UNITTESTING| "building" stage with "uploading" for the embedded target (`issue #4307 `_) * Fixed an issue when a custom `pio test --project-config `__ was not handled properly (`issue #4299 `_) 6.0.2 (2022-06-01) diff --git a/platformio/test/runners/base.py b/platformio/test/runners/base.py index 2a0e6cec..218e0c11 100644 --- a/platformio/test/runners/base.py +++ b/platformio/test/runners/base.py @@ -117,6 +117,9 @@ class TestRunnerBase: 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: @@ -132,9 +135,12 @@ class TestRunnerBase: ) 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")