PlatformIO Community

Native test problem

Hi i’m trying to run some native tests with my project.
The file i’m gonna test is in lib directory - there are not any hardware code or includes - just logic.
Only the hardware files are including this logic files, but it shouldn’t be a problem because I’ve also tried without it.

But when i run “pio test -e native” then it builds also other private libs which use hardware and i’m getting a lot of errors like “no such file or directory” like “stm32f1xx.h”
Is there any option to exclude this libraries from testing? I’ve tried with lib_ignore or src_filter but it wasn’t work… Or maybe I am doing something wrong, I’m new into unit testing

Move your file with the tests into a folder named test (located at the same level of your project structure like the folders src or lib)

1 Like

Please read https://docs.platformio.org/en/latest/plus/unit-testing.html

1 Like