Based on the documentation it is unclear to me what the test_ignore
build option (and pio test
CLI flag) is looking at.
Is it file name, or is it maybe the unit test (test case to be precise) name? I was hoping it will work for file names but it doesn’t seem to work that way.
Use case: I can’t have common unit tests for native
and other arduino-based platforms (arduino, esp32) - that’s because native platform expects main()
function whereas arduino expects setup()
.
Based on my testing it doesn’t work for file names, as I have following layout:
tests/
integration_foo.cpp
test_foo.cpp
For native I want to run files starting with test_
(these include only my libraries) and for real microcontrollers I want to run integration_
files - there will be a code that will use real arduino dependency libraries.
I made following config in platformio.ini:
[env:esp32]
test_ignore =
test_*
[env:native]
test_ignore =
integration_*
But it doesn’t work - running pio test -e native
still is compiling integration_foo.cpp
.