You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature request. Currently the command to compile a unit test binary is one g++ invocation with all the required cpp files given as arguments in addition to the unit test cpp file. Could you change this so that the non-unit tests cpp files are compiled to object files separately first, and then just linked with the unit test binary? Also before compiling an object file, skip compilation if the object file already exists.
E.g.
foreach (file in cpp_files_arduino and cpp_files)
obj_file = get_obj_file_name(file)
if (!exists obj_file)
compile file
foreach (file in cpp_files_unittest)
compile file, corresponding_obj_files
This is required in order to support code coverage result accumulated from multiple unit test binaries (see this answer for details). And regardless of code coverage support, this will be a compilation time improvement when there are multiple unit test files because the source files do not have to be compiled multiple times.
The text was updated successfully, but these errors were encountered:
I like the idea of providing code coverage, in the most accurate way possible. I was going to delay this feature a bit, but after sleeping on it I think it can go forward.
My initial reservation was that this feature request is related to a much deeper (and darker) problem to solved: how to generate a build strategy for 3 separate codebases
the arduino unit testing apparatus
any dependencies on Arduino libraries, their subfolders, their subdependencies, etc
the actual library under test
Most Arduino libraries seem to include few if any dependencies on other libraries, so I assume that pure luck is the reason that arduino_ci has been a usable and useful tool when it comes to unit testing. I'm holding out hope that this project will come to some sort of critical mass, at which point the Arduino IDE can do most of the heavy lifting on sorting out build order and argument lists for g++.
But in this case, all that's really happening is doing the same build strategy but converting all the non-unittest files to objects beforehand, then referring to their corresponding .o in the g++ command.
One thing that I'm not handling right now is the idea of files that are not unittests themselves, but common to the unit test files. Aside from that, I will see about doing this.
This is a feature request. Currently the command to compile a unit test binary is one
g++
invocation with all the required cpp files given as arguments in addition to the unit test cpp file. Could you change this so that the non-unit tests cpp files are compiled to object files separately first, and then just linked with the unit test binary? Also before compiling an object file, skip compilation if the object file already exists.E.g.
This is required in order to support code coverage result accumulated from multiple unit test binaries (see this answer for details). And regardless of code coverage support, this will be a compilation time improvement when there are multiple unit test files because the source files do not have to be compiled multiple times.
The text was updated successfully, but these errors were encountered: