-
Notifications
You must be signed in to change notification settings - Fork 0
test: Add unit tests for serialOpen, serialClose, serialRead, and ser… #11
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
Conversation
|
Please refactor to individual files place them next to the corresponding function and suffix the files with |
|
One file for all unit tests is way to large |
Mqxx
left a comment
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.
Refactor
that feels like bloating the src folder to me, im more used to having tests in a separate test folder |
anyways, where would i place my helper functions / classes that are only needed for tests |
…dd new unit tests - Excluded test files and helpers from library source files in CMakeLists.txt. - Added unit tests for serialClose, serialOpen, serialRead, and serialWrite functions. - Introduced error capture mechanism for better error handling in tests. - Implemented integration tests for serial communication with Arduino and pipe round trips. - Removed outdated test_serial_functions.cpp file.
Unit tests should not be seen as "bloat" they are also an important part in the sourcecode even though "the app could exist without them". Putting them in a separate folder would mean that you either put everything into one file, which gets pretty much unmaintainable at some point, or you could try to mimic the folder structure in the test folder of your source folder for every file which gets pretty annoying if you do any thing of refactoring like moving files around even if you don't do it often. Placing the test files next to the actual files that they test also helps to find them more easily (that's also the reason for the |
- Cleaned up test files by removing unnecessary commented headers for serialClose, serialOpen, serialWrite, and integration tests.
dfce9ab to
ba763c9
Compare
…ialWrite functions