-
Notifications
You must be signed in to change notification settings - Fork 1
Add testing support to the LLServer #7
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
fa70e83 to
49a0fb8
Compare
3e56ee6 to
cc7920e
Compare
e3021ff to
29e46ae
Compare
077a73a to
d1d1637
Compare
|
I manually merged the main branch into this branch because the automatic merge caused a conflict (the same variables ended up declared twice) |
a518518 to
351046e
Compare
- bumped google test version to 1.17
…ey are swapped in the json. Currently the test fails
factor out linear and no interpolation to dedicated functions.
351046e to
8181087
Compare
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.
Pull Request Overview
Adds testing support and refactors file I/O to enable unit tests for the LLServer’s SequenceManager, fixes the “start” bug, and ensures the “END” field is executed.
- Introduce JSON test data and GoogleTest cases for SequenceManager behavior
- Replace direct filesystem calls with a FileSystemAbstraction singleton for mocking
- Update SequenceManager to use the new abstraction, add interpolation helpers, and correct timing
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/data/SequenceManagerTestData.h | New JSON fixtures for start/execution, interpolation, swaps, UTF8 |
| tests/SequenceManagerTest.cpp | Unit tests for start-once, interpolation, abort, UTF8 handling |
| tests/CMakeLists.txt | Setup of GoogleTest and test target |
| src/utility/FileSystemAbstraction.cpp | New concrete implementation of filesystem abstraction |
| src/utility/LoopTimer.cpp | Added time field but missing update in wait() |
| src/utility/JSONMapping.cpp | Switched file I/O to FileSystemAbstraction |
| src/utility/Config.cpp | Switched config load to FileSystemAbstraction |
| src/SequenceManager.cpp | Integration of FileSystemAbstraction, interpolation refactor |
| include/utility/LoopTimer.hpp | Made getters const |
| include/utility/Singleton.h | Added SetInstance() for DI |
| include/SequenceManager.h | Added interpolation API and new member for filesystem |
| include/LLInterface.h | Made methods (and destructor) virtual for mocking |
| include/EventManager.h | Made methods (and destructor) virtual for mocking |
| CMakeLists.txt | Split into a library and executable; enable testing |
| .github/workflows/gtest.yml | CI workflow for building and running GoogleTests |
Comments suppressed due to low confidence (4)
include/SequenceManager.h:70
- The doc comment is missing the word “time” after “end”. E.g. “The first element is the end time, and the second element is …”.
* The first element is the end ,
include/LLInterface.h:50
- Declared a virtual destructor but no definition is provided. Add
LLInterface::~LLInterface() = default;in a .cpp to avoid linker errors.
virtual ~LLInterface();
include/EventManager.h:75
- Declared a virtual destructor but no definition is provided. Implement
EventManager::~EventManager() = default;or provide an empty definition in the .cpp.
virtual ~EventManager();
tests/SequenceManagerTest.cpp:8
- [nitpick] This include of
<utility>isn’t used in the test. You can remove it to keep dependencies minimal.
#include <utility>
|
@miDeb |
Added release preset which should be used Added Options to Cmake for disabling subfeatures
This PR adds testing support for the LLServer and tests of the Sequencemanager. It also fixes the "start bug" which caused a lot of problems. The "END" field in sequences is now executed as well.
To do this I had to change quite a lot of the code base to even make it somewhat testable. Most notable is that I had to turn a lot of classes into Singletons which I don't really like but at least it works now
Right now I am only testing the start bug and interpolation. More suggestions are welcome :)
Todo:
Tests to add:
I'm looking forward for some feedback on my testing abstractions and how I do my tests before I commit to writing a lot of them.