Unit tests for PIO library

From this post, I’m trying to understand how to run unit tests only on a library (under the lib directory). Any tests in the ./lib/my_lib/test directory aren’t detected and don’t run when testing the project.

  • lib
    –my_lib
    ---- include
    ---- src
    ---- test (Files not found)
  • include
  • src
    – main.cpp
  • test (OK tests are working)

Do I need a separate platformio.ini in each library that I want tests in?

See Redirecting...

PIO Unit Testing engine works with projects. You can write tests in a project that cover logic of your libraries/components. See example platformio-examples/unit-testing/calculator at c442de34a57b54451170dbe39f3411a06a05b3f2 · platformio/platformio-examples · GitHub