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

Unit testing #241

Closed
azonenberg opened this issue Oct 21, 2020 · 3 comments
Closed

Unit testing #241

azonenberg opened this issue Oct 21, 2020 · 3 comments
Labels
build Build system and infrastructure

Comments

@azonenberg
Copy link
Collaborator

Top level meta-issue for setting up some kind of unit test framework. CTest may be worth using since it integrates well with CMake, but I'm open to other options.

The hard part of course is going to be figuring out what to test, refactoring code to be more testable, etc.

@azonenberg azonenberg added the build Build system and infrastructure label Oct 21, 2020
@azonenberg
Copy link
Collaborator Author

There's now a simple unit test for FrequencyMeasurement in #242 (tests/FrequencyMeasurement). It runs with no arguments and exits with 0 on success and nonzero on failure.

@tarunik
Copy link
Contributor

tarunik commented Oct 22, 2020

Catch2 is probably the simplest to get started with, at least in its current stable incarnation -- testcases are just funny looking free functions, with setup/teardown handled elegantly, and very little configuration needed, while still supporting rich assertion output.

@azonenberg
Copy link
Collaborator Author

Proposal:

  • CTest as top level test framework
  • Use CTest's "one executable per test case" model for testing filters as they tend to be more complex and have more baggage
  • Use Catch2 under CTest for smaller scale testing of single functions etc

Sorry, something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system and infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants