stellarium
stellarium copied to clipboard
Add test configurations for Observability plugin.
Description
Add test configurations for Observability plugin.
Screenshots (if appropriate):
Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] This change requires a documentation update
How Has This Been Tested?
Compiles. Only a dummy test has been added.
Test Configuration:
- Operating system: macOS Catalina v10.15.7
- Graphics Card: Intel Iris 1536 MB
Checklist:
- [x] My code follows the code style of this project.
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation (header file)
- [ ] I have updated the respective chapter in the Stellarium User Guide
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
This compiles, but I haven't been able to figure out how to actually run the tests. I followed the instructions in BUILDING.md, but I'm not sure from which directory I'm supposed to run make test
or ctest --output-on-failure
(e.g. root dir, build/macosx
dir, or the plugin test dir). ctest
keeps saying that no tests were found.
Also, I have ENABLE_TESTING set to ON. Any suggestions?
Please try run tests within QtCreator
I fear unit tests will not work for this plugin due core class (singleton)
Can you elaborate on how to do it through QtCreator?
I would like to get the dummy test working just so I can start looking into refactoring the plugin.
Can you elaborate on how to do it through QtCreator?
ENABLE_TESTING property should be set ON in QtCreator and after run cmake on bottom bar you will see extra section for unit testing
Awesome, found it. Thank you!
Any progress here?
I've made progress on this. I've been testing out the feasibility of using the FakeIt mocking testing lib, which would allow for running tests against functionalities that use StelCore. Still working on getting a complete test running, but if I can, this would at least allow tests to be written for the Observability plugin while it's being refactored.