Native Advanced Test is trying to build all libs

I’ve added a very basic test to my project in the test folder (see below).

And I’ve added a section to platform.io for [native]. Unfortunately, when I run Advanced → Test it tries to build all of my libraries that have platform-specific dependencies.

Is there any way to filter the libraries that are included? I can’t find any options in the testing documentation to do this.

platform.io configuration:

[env:native]
platform = native
targets = test
test_build_project_src = false
# enable C++11 extensions
build_flags = -std=c++11

Simple unit test:

#include <unity.h>
#include <string.h>

void test_example(void)
{
  TEST_ASSERT_EQUAL(6, 3 + 3);
}

int main(int argc, char **argv)
{
  UNITY_BEGIN();
  RUN_TEST(test_example);
  UNITY_END();

  return 0;
}

So, turns out you can do this:

lib_ignore = 
  epdiy
  sd_card

And ignore libraries you don’t want. I didn’t see any mention of this in the unit testing documentation - might be quite handy as I’m sure other people have hit this roadblock.

2 Likes

For completnes: Library options of the platformio.ini reside in the “Library options” section of the platformio.ini documentation, Redirecting....