Ignore [env] settings

We now have quite a lot of environments so I like to use global settings using the [env] tag.

But there are exceptions for the native unit tests. So the platform becomes native, but I don’t need a board or framework.

Here’s my [env] as an example:

[env]
board = featheresp32
platform = espressif32
framework = arduino

And here’s a unit test:
[env:someGenericUnitTests]
platform = native
lib_ldf_mode = deep
test_framework = unity

I tried to add
[env:someGenericUnitTests]
platform = native
board =
framework =
lib_ldf_mode = deep
test_framework = unity

But that didn’t work… Any suggestions or do I need to go back to add the globals to each environment individual?

Thx!
David

Only put settings into [env] that you really want to be inherited (or at least modified) in all other environments.

Additionally, you can use extends = some_base_environment (docs) with environments not starting in env: (those won’t show up in the project environment selector).

So you could have

[base_esp32]
board = featheresp32
platform = espressif32
framework = arduino

[env:someGenericUnitTests]
platform = native
lib_ldf_mode = deep
test_framework = unity

[env:someActualESP32Board]
extends = base_esp32
; additional modifications like build_flags, lib_deps, ...

An example:

Hi Max,

Thanks! That’s a perfect solution.

Regards,
David