Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override of "add_psp_module" for coverage test gets global scope #305

Closed
jphickey opened this issue Sep 3, 2021 · 0 comments · Fixed by #306 or #307
Closed

Override of "add_psp_module" for coverage test gets global scope #305

jphickey opened this issue Sep 3, 2021 · 0 comments · Fixed by #306 or #307

Comments

@jphickey
Copy link
Contributor

jphickey commented Sep 3, 2021

Describe the bug
In order to (attempt to) implement coverage test for PSP modules without redefining the sources for that module, the Cmake script currently redefines the add_psp_module function to do something different when building for coverage tests.

Problem is, this override ends up getting global scope, not directory scope. So in the event that multiple modules are specified and if the psp library gets built first (which will include coverage test if enabled), then any modules built after the psp will fail, because they use the coverage test override function rather than the proper function as defined in arch_build.cmake

To Reproduce
Create a project utilizing several PSP modules/extensions for custom HW access. Modules will fail to build when ENABLE_UNIT_TESTS is set true, even if they do not contain a coverage test, because the FSW build is using the wrong definition of the add_psp_module function.

Expected behavior
Should build successfully.

Code snips
Root of the problem is this override at:

function(add_psp_module MODULE_NAME)

System observed on:
Ubuntu

Additional context
This function definition ends up getting global scope, not directory scope, so even after returning to the parent directory, this modified definition remains active.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit to jphickey/PSP that referenced this issue Sep 3, 2021
Implements a differently-named function instead, which does mostly the same thing,
but does not directly re-add the original subdirectory.  This does repeat some
info (e.g. the list of FSW source files) that was not repeated otherwise, but
it works in general.
jphickey added a commit to jphickey/PSP that referenced this issue Sep 3, 2021
Implements a differently-named function instead, which does mostly the same thing,
but does not directly re-add the original subdirectory.  This does repeat some
info (e.g. the list of FSW source files) that was not repeated otherwise, but
it works in general.
astrogeco added a commit that referenced this issue Sep 7, 2021
Fix #305, do not override add_psp_module for coverage test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant