Hello there, I have the following folder structure in my project:
or
├── .vscode
│ ├── c_cpp_properties.json
│ ├── extensions.json
│ ├── launch.json
│ └── settings.json
├── include
│ └── README
├── lib
│ └── c_buffer
│ ├── c_buffer.c
│ └── c_buffer.h
├── platformio.ini
├── README.md
├── src
│ ├── main.c
│ └── main.h
├── test
│ ├── test_circular_buffer_f401re.c
│ ├── test_circular_buffer_native.c
│ ├── unity_config.c
│ └── unity_config.h
└── workspaceToText.txt
I’m trying to get 2 different test builds, one for native (windows MinGW) and another for Nucleo F401RE board (arm-gcc). My logic is as follows:
I just want to include the corresponding test file (*_native/f401re) and remove unity config in case I’m testing my native env. When using the nucleo, I want to filter out the native test. I’m currently using build_src_filter, but to no avail. I’ve tried /, , // as the path separator, but nothing. It won’t filter out those files, so the project can’t build correctly. I haven’t modified the default path for build_src_filter, so it should default to my /src folder, in the same level as /test.
Am I overlooking something obvious here? Is build_src_filter intended to be used in other way or only for files under the /src? I really can’t tell. Any help is appreciated!
My platformio.ini is as follows:
[env:native]
platform = native
debug_test = *
build_flags =
-Werror
build_src_filter =
-<../test/test_circular_buffer_f401re.c>
-<../test/unity_config.c>
[env:nucleo_f401re]
platform = ststm32
framework = stm32cube
board = nucleo_f401re
debug_test = *
build_src_filter =
-<../test/test_circular_buffer_native.c>
build_flags =
-Werror
-I"C:\Users\Jose\.platformio\packages\framework-stm32cubef4\Drivers\STM32F4xx_HAL_Driver\Inc"
-I"C:\Users\Jose\.platformio\packages\framework-stm32cubef4\Drivers\STM32F4xx_HAL_Driver\Src"