-
Notifications
You must be signed in to change notification settings - Fork 2
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 Testing Framework #405
Open
KnockbackNemo
wants to merge
58
commits into
master
Choose a base branch
from
feature/unit-testing-framework-394
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…dition of fff using Contactors; added Unity files.
…ST_LEADER checks if there is a valid test file in the Tests folder but unit tests are kept in a different directory. Unit tests currently don't use the Test_ prefix nor do they check for a valid file, but we may want to add these features later on.
…g for ifdefs to see if it helps with including files.
…le and also life Co-authored-by: Madeleine Lee <[email protected]>
… makefile, made a new Test_Pedals.c in UnitTests as a temporary file to make it compile since the makefile can't seem to find the test in the Tests folder.
…ariable, which didn't take into account the Tests/ directory. Also renamed the output file executable to be .out instead of .o since it is full, linked executable and not just an object file. FInally, add as a prerequisite to compile the unit test. I believe this will tell the Makefile to recompile the executable if any of the C_SOURCES have been changed since it was last compiled.
… public on the master branch, so I'm pretty sure it's okay.
…_INCLUDES now uses the explicit paths for the mocks instead of the wildcard function since it wanted a directory instead of files and also because it needed the -I part appended to each path anyways; New flag -DTEST_ uses the name of the file we're testing and defines it as TEST_<FILE>. This can be used in #ifdefs to determine if we want to include a regular header or a mock header. I'm not sure if putting an ifdef in each mock header is the best way to do it, but it was the easiest way I could think of at the moment. The mock Contactors.h is an example of this. Test changes: Made additional mocks so that Test_Contactors runs; moved the DEFINE_FFF_GLOBALS to the test file since this can only be defined once, and we at least know we'll only be running one test file at a time. In mock headers where we sometimes want to mock and sometimes want to test (ex: Contactors, Apps), the #include_next macros will include the second instance of the file on the search path. This means if we include the mocks before the normal headers in C_INCLUDES, we can use #include_next to choose the normal header. Not the cleanest way of doing things, but hopefully it at least works for now.
…d for OS, contactors working with OS, initial version of RCC
… tasks as the task mocks are not being referenced
…gcc searches the current directory for #include files before the -I directories, so using the real ReadCarCAN.h caused gcc to use the real Tasks.h since it resides in the same directory. Adding -iquote stops the compile from searching the current directory unless it is listed as a -I flag directory, so now fake Tasks.h will still be found first, even if we use a file in the real Apps/Inc!
…nged Makefile a bit more to use deprecated -I- for now since it seems to work better than iquote, which would cause the directory after to become unable to be found.
…d correctly and doesn't compile.
… Test_ReadCarCAN.
…hould cover all the parts of the os we need, I think?
Might need to merge in master to get stuff to build properly on GH Actions. May have some merge conflicts |
… confused / Added a filter to the unit test makefile to ensure we find the correct real source file to test and not accidentally a mock one.
…olar/Controls into feature/unit-testing-framework-394
…es so that things work with the new cleaned-up codebase.
…ests, fixed other small changes related to merge issues so that the unit tests run.
…t this at least tests the logic we probably want to test for a unit test. Also moved some makefile define flags into C_DEFS since only those flags will be compiled with clang format/tidy (we were failing those checks before.
IshDeshpa
requested changes
Feb 8, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff! A few notes though:
- Many of the headers for the RTOS and CPU seem like they just do the same thing as the original headers without any difference. If this is the case, why make a duplicate?
- See LOOP macro comments.
- See anything else I've put down
…ng a LOOP macro that replaces while(1).
…ral Objects folder.
…le of this in HelloWorld file
Merge in master pls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quality Assurance Checklist
To make reviews more efficient, please make sure the software feature meets the following standards and check everything off that meets the quality check. Once everything has been checked, the assigned reviewers will begin the review process. Edit this description to check off the list.
There are exceptions with all guidelines. As long as your decisions are justified, then you are good! Contact the reviewers or the leads about any exceptions.
Requirements
Things to Consider