Do not resolve dependencies from the project "src" folder when the test_build_src option is not enabled

This commit is contained in:
Ivan Kravets
2022-06-15 18:05:55 +03:00
parent ac63cf0240
commit e12bc9fe5f
2 changed files with 11 additions and 4 deletions

View File

@ -24,9 +24,13 @@ PlatformIO Core 6
- Replaced ``monitor_flags`` with independent project configuration options: `monitor_parity <https://docs.platformio.org/en/latest/projectconf/section_env_monitor.html#monitor-parity>`__, `monitor_eol <https://docs.platformio.org/en/latest/projectconf/section_env_monitor.html#monitor-eol>`__, `monitor_raw <https://docs.platformio.org/en/latest/projectconf/section_env_monitor.html#monitor-raw>`__, `monitor_echo <https://docs.platformio.org/en/latest/projectconf/section_env_monitor.html#monitor-echo>`__
- Fixed an issue when the monitor filters were not applied in their order (`issue #4320 <https://github.com/platformio/platformio-core/issues/4320>`_)
* **Unit Testing**
- Merged the |UNITTESTING| "building" stage with "uploading" for the embedded target (`issue #4307 <https://github.com/platformio/platformio-core/issues/4307>`_)
- Do not resolve dependencies from the project "src" folder when the `test_build_src <https://docs.platformio.org/en/latest//projectconf/section_env_test.html#test-build-src>`__ option is not enabled
- 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>`_)
* Improved a serial port finder for a board with predefined HWIDs
* 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)
~~~~~~~~~~~~~~~~~~

View File

@ -889,10 +889,13 @@ class ProjectAsLibBuilder(LibBuilderBase):
return include_dirs
def get_search_files(self):
items = []
build_type = self.env.GetBuildType()
# project files
items = super().get_search_files()
if "test" not in build_type or self.env.GetProjectOption("test_build_src"):
items.extend(super().get_search_files())
# test files
if "test" in self.env.GetBuildType():
if "test" in build_type:
items.extend(
[
os.path.join("$PROJECT_TEST_DIR", item)