Pulling a remote git repo with tests as a lib_deps

If my remote repo has any unit tests (.cpp files under “test” folder), PIO is only pulling in those .cpp files into the lib_deps folder.

If I remove all of the unit tests from the remote repo, it pulls in the library just fine. Is there a setting I’m missing somewhere? Thanks!!


What’s the exact library repo?


I mean, the actual link. For inspection of all the files. Or is it internal / confidential?

Oh sorry, yeah, internal/confidential. It’s just weird that it pulls only the tests if they are present and works fine when no tests are present.

Does the test folder have a library.json in it? What’s its content? PlatformIO has logic which tries to dynamically look for the actual root of the project, by locating either its manifest file (library.json) or the first folder containing code. Can you post a tree structure of the folder? Without that info it’s very hard to say anything else than very generic things o_o.

Thanks Max, that makes sense. Unfortunately, there is no library.json. Here is the structure:

|  |- (only header files)
|  |- (only .cpp files)
|  |--embedded
|  |  |-sd_settings.cpp

platformio.ini contents:

platform = teensy
board = teensy41
framework = arduino
lib_deps = 
adafruit/Adafruit SSD1306@^2.4.4
	adafruit/Adafruit GFX Library@^1.10.7
	adafruit/Adafruit BusIO@^1.7.3

Can I use a library.json file to ensure pio uses the project root?

A library is usually of the format as described in here and library.json, your library has… a platformio.ini? That’s a firmware project then. Usually a library just has the library code and example sketches in examples, projects that use the libraries are outside of it otherwise. Take a look at say, ArduinoJson.

This could work. Have you tried it?

Awesome, yes, adding a library.json to the root dir solved it. Thank you for your help!