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

Document nested usage of UT_ADD_TEST and clarify nomenclature for individual versus groups of tests #841

Closed
astrogeco opened this issue Aug 25, 2020 · 1 comment
Labels
docs This change only affects documentation. duplicate unit-test

Comments

@astrogeco
Copy link
Contributor

astrogeco commented Aug 25, 2020

Describe the problem

The UT_ADD_TEST call has some limitations as addressed in #840. Some solutions are discussed in that PR.

Proposed Solutions

  1. Have UT_ADD_TEST handle "nested" unit tests, OR
  2. Develop a nomenclature for unit test functions that explicitly indicates whether there are nested unit tests and then rename unit tests accordingly, OR
  3. Document the anti-pattern, OR
  4. Split up all unit tests to ensure only one test per function and make this a design pattern.

Additional Context

Originally posted by @skliper in #840 (comment)

Related to nasa/osal#577. Individual tests are added w/ the UT_ADD_TEST call. Some tests are grouped at a lower level (Test_MSG_CCSDSExt is a group of tests), and those functions are called directly. Same pattern is used in sb:

Test_SendMsg_API();
UtTest_Add(Test_RcvMsg_API, NULL, Test_CleanupApp_API, "Test_RcvMsg_API");

@astrogeco astrogeco changed the title Related to nasa/osal#577. Individual tests are added w/ the UT_ADD_TEST call. Some tests are grouped at a lower level (Test_MSG_CCSDSExt is a group of tests), and those functions are called directly. Same pattern is used in sb: ISSUE opened by mistake Aug 25, 2020
@astrogeco astrogeco changed the title ISSUE opened by mistake Document nested usage of UT_ADD_TEST and clarify nomenclature for individual versus groups of tests #578 Aug 25, 2020
@astrogeco astrogeco changed the title Document nested usage of UT_ADD_TEST and clarify nomenclature for individual versus groups of tests #578 Document nested usage of UT_ADD_TEST and clarify nomenclature for individual versus groups of tests Aug 25, 2020
@astrogeco astrogeco reopened this Aug 25, 2020
@skliper skliper added docs This change only affects documentation. unit-test labels Sep 9, 2020
@skliper
Copy link
Contributor

skliper commented Jan 11, 2021

Documented in nasa/osal#577 and addressed by nasa/osal#751, closing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change only affects documentation. duplicate unit-test
Projects
None yet
Development

No branches or pull requests

2 participants