Skip to content

Update/resurrect the add_unit_test_lib/add_unit_test_exe functions #1207

@jphickey

Description

@jphickey

Is your feature request related to a problem? Please describe.
Currently the arch_build.cmake functions provide a routine to easily define a CFE app: add_cfe_app() . This makes it easy for app developers to create an app target that uses all the right compiler definitions, include dirs and link/interfaces libraries. Furthermore, having this wrapper in CFE helped future-proof so that apps didn't need to change this call when #972 was implemented.

The problem is that we didn't employ the same tactic for unit tests. For these, all the special logic for adding flags/includes is basically put into the CMakeLists.txt in each app where the UT targets are defined.

Describe the solution you'd like
The arch_build.cmake does have a add_unit_test_lib and add_unit_test_exe function that was originally intended for this purpose, but these were never really used. We should implement the basic UT logic here and change sample app/lib to use them.

Additional context
Currently, the sample_lib/sample_app unit tests break when merging with #1203 because of the different paths and the transition toward interface libraries. Rather than just updating these UT builds to work again, using these functions would help avoid this issue in the future.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions