Skip to content

gcc "--wrap" argument and stubs for OS-provided functions #382

@CDKnightNASA

Description

@CDKnightNASA

Is your feature request related to a problem? Please describe.
I've been frustrated that we don't have unit tests for checking that OSAL properly handles error conditions when calling OS functions (like open, read, socket, accept, etc.) Apparently if we define --wrap=open, then all calls to open() will go to our open() function and the OS-provided open will be renamed as __wrap_open(). I suggest this be used to stub most/all OS calls and we can add unit tests for such things as running out of memory/storage/file descriptors and also support unit testing in sandboxed environments (don't know if Travis CI sandboxes) where such things as network calls are disabled.

Describe the solution you'd like
Stub functions for OS functions.

Describe alternatives you've considered
Been looking around for alternatives and haven't seen any.

Additional context
Add any other context about the feature request here.

Requester Info
[email protected]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions