Skip to content
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

Add test configurations for Observability plugin. #2570

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

colossatr0n
Copy link
Contributor

Description

Add test configurations for Observability plugin.

Screenshots (if appropriate):

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • 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:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • 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

@colossatr0n
Copy link
Contributor Author

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?

@alex-w
Copy link
Member

alex-w commented Aug 14, 2022

Please try run tests within QtCreator

@alex-w
Copy link
Member

alex-w commented Aug 14, 2022

I fear unit tests will not work for this plugin due core class (singleton)

@colossatr0n
Copy link
Contributor Author

colossatr0n commented Aug 14, 2022

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.

@alex-w
Copy link
Member

alex-w commented Aug 14, 2022

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

@colossatr0n
Copy link
Contributor Author

Awesome, found it. Thank you!

@gzotti
Copy link
Member

gzotti commented Sep 19, 2022

Any progress here?

@colossatr0n
Copy link
Contributor Author

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.

@alex-w alex-w added the subsystem: plugins The issue is related to plugins of planetarium... label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: plugins The issue is related to plugins of planetarium...
Development

Successfully merging this pull request may close these issues.

3 participants