By default, PlatformIO does not build the main source code from the src_dir folder in pair with a test source code. [...] We recommend splitting the source code into multiple components and placing them into the lib_dir (project’s private libraries and components).
Although this is not the only option available for unit tests, but the recommended one.
I infer that:
there actually is at least one technical difference whether the modules are put into src or lib directory
in case unit tests are envisioned for the modules, the recommended way is to put them into the lib directory
the src/ directory is designated to perform dependency injection for the productive software (in contrast to the test software); compare to "Main Component" for dependency injection (here or in "Clean Architecture" by R. C. Martin)
I think I found an answer to the question about whether to put modules into
src
orlib
directory.The PlatformIO documentation explains:
Although this is not the only option available for unit tests, but the recommended one.
I infer that:
src
orlib
directorylib
directorysrc/
directory is designated to perform dependency injection for the productive software (in contrast to the test software); compare to "Main Component" for dependency injection (here or in "Clean Architecture" by R. C. Martin)