-
Notifications
You must be signed in to change notification settings - Fork 202
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
Unit test macros and example use with SB #492
Unit test macros and example use with SB #492
Conversation
I've committed changes that use UtAssertEx() calls instead of my code. :D |
CCB 20200212 - Approved concept, @CDKnightNASA will go forward with implementation and update macros for reporting values and prefixes etc. |
Note that the UtAssertEx function always generates an entry in the stdout, so the sb_UT would generate ~1,800 "tests" instead of the 182 of the trunk. I assume the latter is the "correct" behavior? |
I actually prefer to see all the test cases. The only exception is if it is a sanity check of the test case itself i.e. like a test buffer being of sufficient size or otherwise using UT assert API to check for fundamental flaws in the test case itself as opposed to the FSW function outputs. (In this case the "pass" messages really are just clutter). But in any case where it is checking the output of the FSW code, it should make an entry in the log. The count doesn't matter. Note you can also separately suppress "pass" output and show only failures if the log file gets too big. |
A lot of checks in sb_UT are checking of setup steps to make sure the setup is correct...So if you want to see all of the setup steps in the log...? A good example is Test_CreatePipe_MaxPipes() which calls CreatePipe CFE_PLATFORM_SB_MAX_PIPES + 1 times, and reports each CreatePipe, even though we only really care about the last one and only really care if it (or any prev. calls) fails. |
4dc0510
to
b91ffdd
Compare
I think we discussed this? If not, my suggestion is just keep a status or check that they all create and report success or failure once. No benefit to the reporting being inside the loop. Oh, and break up the success and failure calls. Do the successful creation loop first, report if it passed or failed, then do the +1. edit added 2nd statement. |
Nice thing is with macros, we could have a single #define to enable/disable the SETUP/TEARDOWN/etc. reporting. |
b91ffdd
to
5dc679c
Compare
I've taken a fresh crack at this, modeling it more like the OSAL unit test macros, to make them semantically clear as to what the tests are doing. I have some questions for the CCB:
|
CCB 20200422 - Discussed. House them in ut_support so they can be used in all subsystems. Will benefit from a targeted review. |
FYI I've written up a page in the wiki (that could be incorporated into the git repo): |
dffc309
to
b292a10
Compare
bc0d2dc
to
c18cd91
Compare
some more updates, squashed commit |
Separate may be easier? Although I don't foresee any issues with accepting sb_UT.c. I would like to get the support changes in quickly such that we can start updating the rest as soon as the core code updates are done. |
Note I just fought with es_UT for a while and almost lost, can't wait to update it. |
I thought it was going to output the expected and actual values? I may have missed it... |
Only on a failed test. |
CCB 2020-04-29 : APPROVED |
@CDKnightNASA can you resolve the conflicts? |
working this, lots of conflicts. :/ |
conflicts resolved |
I have some other goofs to commit, plus some cleanup to use the new macros, will push them within the hour. |
@CDKnightNASA once merged to IC, it's easier if you open a new pr |
Ok, sorry I broke some of the MID abstraction in sb_UT...Given how many other changes in PSP, OSAL, etc. it is difficult for me to test my changes anyways until everything settles back into all of the master branches. :o |
Describe the contribution
sample macro-ification of UT code for CCB consideration.
Partial implementation of #491
Fix #418
Testing performed
made SB unit tests and confirmed all passed.
Expected behavior changes
simplified UT code
System(s) tested on
Debian Linux
Contributor Info - All information REQUIRED for consideration of pull request
Christopher.D.Knight@nasa.gov
EDIT: Added this fixes #418