Conversation
jr1221
left a comment
There was a problem hiding this comment.
super awesome this is amazing stuff. very complicated at first glance but I think we will get the hang of it. Ill try and run tests later this week
| /** | ||
| * @brief determines if APPS should fault based on pedal readings | ||
| */ | ||
| bool calc_pedal_faults(float accel1, float accel2, float accel1_norm, |
There was a problem hiding this comment.
there is absolutely no way these can remain private right?
There was a problem hiding this comment.
yeah unfortunately the downside is that if we want to test the file it has to be exposed in a header
| void sound_rtds() | ||
| { | ||
| osThreadFlagsSet(rtds_thread, SOUND_RTDS_FLAG); | ||
| } | ||
|
|
There was a problem hiding this comment.
I can revert this, I thought I had to do this originally to test but it was unnecessary
|
|
||
| if (get_tsms()) { | ||
| osThreadFlagsSet(rtds_thread, SOUND_RTDS_FLAG); | ||
| sound_rtds(); |
There was a problem hiding this comment.
is this so sound_rtds can be tested?
There was a problem hiding this comment.
I though so originally, but then realized it can be tested without doing this so I can revert it
|
|
||
| debounce_Ignore(); | ||
| debounce_Ignore(); | ||
| TEST_ASSERT_EQUAL_INT(calc_pedal_faults(3.2, 1.2, 0.50, .30), false); |
There was a problem hiding this comment.
these change too often to always be right, perhaps within a certain threshold?
There was a problem hiding this comment.
Yeah there are definitely ways we can test if values are within certain thresholds with the Unity functions, I can try to expand on this as a proof of concept
| services: | ||
| ner-gcc-arm: | ||
| image: ghcr.io/northeastern-electric-racing/embedded-base:main | ||
| image: ghcr.io/northeastern-electric-racing/embedded-base:unity-testing |
UNITY TESTING ON CERB
Doc for instructions:
testing-guide.md
Also made a small change of wrapping setting the rtds flag in a function. I originally thought this was necessary for testing, but with the updates I made this change is sort of unnecessary and not needed for the testing to work (lmk if you want me to revert that back)
NOTE: Compose yml was change to point to the embedded base unity testing branch image, this will have to be changed once embedded base's
unity-testingbranch is merged into main for the gh action to work. TLDR review and merge Embedded Base first