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

Always build/provide OSAL stub library, decouple from ENABLE_UNIT_TESTS #1328

Closed
jphickey opened this issue Nov 8, 2022 · 0 comments · Fixed by #1329
Closed

Always build/provide OSAL stub library, decouple from ENABLE_UNIT_TESTS #1328

jphickey opened this issue Nov 8, 2022 · 0 comments · Fixed by #1329
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

jphickey commented Nov 8, 2022

Is your feature request related to a problem? Please describe.
Currently, OSAL only provides the stub library (ut_osapi_stubs) when ENABLE_UNIT_TESTS is set.

However, the ENABLE_UNIT_TESTS switch is supposed to cover the testing of OSAL itself, but the stubs are mostly relevant for testing other components.

In a modular deployment, OSAL may be treated as an external/independent component. As such, it may be built separately from the application, with headers and binary libraries installed in a system location e.g. /usr/local or similar. To keep the installation footprint smaller and cleaner, generally build intended for system install like this would be done without unit tests.

However, the lack of ut_osapi_stubs when compiled in this mode means that other components in the system based on OSAL cannot be unit tested either.

Describe the solution you'd like
Always provide ut_osapi_stubs, independently of the ENABLE_UNIT_TESTS switch. This will enable dependent applications to be unit tested, even if OSAL itself is not being tested.

Additional context
Note that UT assert is always provided this way for similar reasons - it is still useful for external "black box" testing (which is done using binaries that are built and linked normally, not stubbed out binaries), and furthermore other applications can be tested even if OSAL itself is not being tested.

In a CFS build, this disconnect was not apparent because the entire system gets the same ENABLE_UNIT_TESTS setting, but in a decoupled/standalone build this is not the case.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Nov 8, 2022
dzbaker added a commit that referenced this issue Nov 17, 2022
Fix #1328: always provide UT stub library
@dmknutsen dmknutsen added this to the Draco milestone Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants