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

Decouple SB and SBR in coverage tests #1462

Open
jphickey opened this issue Apr 30, 2021 · 2 comments
Open

Decouple SB and SBR in coverage tests #1462

jphickey opened this issue Apr 30, 2021 · 2 comments

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently the SB coverage test is not like the others in that it links with the real SBR sub-module, rather than a stub version. This becomes evident when generating the stubs as in #1417

Describe the solution you'd like

  • Make SBR unit tests follow the pattern of all other modules - Generate a set of stubs for SBR using the generator script and it should use the new cmake functions to add the coverage test.
  • Update the SB unit tests where it was depending on having a real SBR implementation (should be just a matter of setting the intended stub output where it was missing)

Additional context
Per the system architecture/design, Each sub-module should be individually coverage tested, using stubs for all other modules. This is an exception to that general design because SBR does not have proper stub functions for testing dependencies in isolation (e.g. SB in this case) like all other modules do.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@skliper
Copy link
Contributor

skliper commented Apr 30, 2021

Note original issue was #962, closed in favor of this one.

@jphickey
Copy link
Contributor Author

Note that the fact that SB and SBR are coupled together during coverage test means certain features of SB might not be reachable in the coverage test. As noted in #1668, collisions are not possible when linked with the "direct" SBR implementation, so collision handling in SB cannot be covered:

if (Collisions != 0)
{
CFE_EVS_SendEventWithAppID(CFE_SB_HASHCOLLISION_EID, CFE_EVS_EventType_DEBUG, CFE_SB_Global.AppId,
"Msg hash collision: MsgId = 0x%x, collisions = %u",
(unsigned int)CFE_SB_MsgIdToValue(MsgId), (unsigned int)Collisions);
}

Splitting SBR from SB for coverage test, and providing stubs for SBR functions (like other modules) would likely improve coverage test capability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants