Skip to content

Compile each non-test cpp file separately first and link object files #113

Open
@hlovdal

Description

@hlovdal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrubygemRuby code is affected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions