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

Consolidate around single base set of unit test APIs (can extend, but should be based on a consistent set) #787

Open
skliper opened this issue Feb 9, 2021 · 6 comments
Labels
unit-test Tickets related to the OSAL unit testing (functional and/or coverage)

Comments

@skliper
Copy link
Contributor

skliper commented Feb 9, 2021

Is your feature request related to a problem? Please describe.
I realize we've discussed this before, but our unit tests are all over the place.

Describe the solution you'd like
We should implement gold-standard patterns, and drive the rest of the system towards that goal as we update unit tests. Really the ASSERT* macros at this point seem like the most informative/standard set but they aren't available to OSAL. Update the ut_assert macros or add ones that match this pattern.

Describe alternatives you've considered
None

Additional context
Developers have added all sorts of non-standard debug statements when if we just used the informative macros the output would be standardized (see #786)

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added the unit-test Tickets related to the OSAL unit testing (functional and/or coverage) label Feb 9, 2021
@skliper skliper added this to the 6.0.0 milestone Feb 9, 2021
@skliper skliper added the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Feb 9, 2021
@jphickey
Copy link
Contributor

We cannot put everything in OSAL - Notably things like events (e.g. EVTSENT macro used by SB) does not apply.

I think we have a generic-enough "int32" check in the form of UtAssert_INT32_EQ() that can be used for return values pretty much globally.

I would like to see a simpler form of some of the other macros be available more globally, though. Basically all of the "older-style" ones that make the user supply their own message string. I very much prefer the ones that just print their arguments with a generic string - easier to use, and actually more informative when it fails.

@skliper
Copy link
Contributor Author

skliper commented Feb 10, 2021

I would like to see a simpler form of some of the other macros be available more globally, though. Basically all of the "older-style" ones that make the user supply their own message string. I very much prefer the ones that just print their arguments with a generic string - easier to use, and actually more informative when it fails.

Yeah, maybe it's just changing the built in ones in OSAL to behave like the cFE ones... I agree the argument print is much more straight forward.

@astrogeco
Copy link
Contributor

CCB:2021-02-17 Discussed

@astrogeco astrogeco removed the CCB:Ready Pull request is ready for discussion at the Configuration Control Board (CCB) label Feb 17, 2021
@skliper skliper changed the title Move general ASSERT* macros to ut_assert Provide ASSERT* (cfe) like macros in ut_assert, gold standard is set that prints test info (no user string) Feb 18, 2021
@skliper
Copy link
Contributor Author

skliper commented Mar 9, 2021

Also should address #752 if not done already. See also #816 for all instances.

@zanzaben zanzaben assigned zanzaben and unassigned zanzaben Mar 15, 2021
@skliper skliper changed the title Provide ASSERT* (cfe) like macros in ut_assert, gold standard is set that prints test info (no user string) Consolidate around single base set of unit test APIs (can extend, but should be based on a consistent set) May 4, 2021
@skliper
Copy link
Contributor Author

skliper commented May 4, 2021

From side chats - really the goal here is to use common macros such that outputs and even hopefully the tests are similar enough as to allow for common processing and analysis patterns. Really trying to make cross checking of API documentation vs tests easier, reporting API coverage, and reducing technical debt due to having to handle each flavor differently. Consistently implemented patterns are easier to update.

@skliper
Copy link
Contributor Author

skliper commented Jun 1, 2021

Related to #484. Concept is to provide a guide as to what macros to use, how to extend (suggested ways to maintain consistency and scriptability, supporting automated verification, etc), where to put custom text if required, etc. Also conversion of all the less-desirable patterns used in the various testing flavors to the standard set.

@skliper skliper removed this from the 6.0.0 milestone Jun 3, 2021
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
 nasa#787
 - cES1005.1: Remove application load address from start app command
 - cTBL6003.1: Clarify table validation pior to activate
 - cEVS3103.4, cEVS3103.5, cEVS3001: Remove SB qualifier
 nasa#587
 - cSB4344: Added get packet type API requirement
 - cSB4345: Added message ID validation API requirement
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unit-test Tickets related to the OSAL unit testing (functional and/or coverage)
Projects
None yet
Development

No branches or pull requests

4 participants