diff --git a/HISTORY.rst b/HISTORY.rst index ef4e815d..2b307a33 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -26,7 +26,8 @@ PlatformIO Core 6 * **Unit Testing** - - Merged the |UNITTESTING| "building" stage with "uploading" for the embedded target (`issue #4307 `_) + - Export |UNITTESTING| flags only to the project build environment (``projenv``, files in "src" folder) + - Merged the "building" stage with "uploading" for the embedded target (`issue #4307 `_) - Do not resolve dependencies from the project "src" folder when the `test_build_src `__ option is not enabled - Fixed an issue when a custom `pio test --project-config `__ was not handled properly (`issue #4299 `_) diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index 7269c708..addc3ce8 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -867,6 +867,8 @@ class ProjectAsLibBuilder(LibBuilderBase): project_src_filter = env.get("SRC_FILTER") super().__init__(env, *args, **kwargs) self.env["SRC_FILTER"] = project_src_filter + if "test" in self.env.GetBuildType(): + self.env.ConfigureTestTarget() @classmethod def get_instance(cls, *args, **kwargs): diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index e6c9d7ba..c08c7438 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -126,8 +126,6 @@ def ProcessProgramDeps(env): if "debug" in env.GetBuildType(): env.ConfigureDebugTarget() - if "test" in env.GetBuildType(): - env.ConfigureTestTarget() # remove specified flags env.ProcessUnFlags(env.get("BUILD_UNFLAGS"))