aqnwb 0.1.0
Loading...
Searching...
No Matches
Testing

Unit Tests

AqNWB uses ctest and CATCH2 for unit testing. Relevant files for the unit tests are located at:

  • /tests : Sources of the unit tests
  • /tests/examples : Sources of example code used in the docs. The examples are implemented like regular unit tests but their purpose is to provide examples for the docs (rather than testing specific cases) and as such commonly include Doxygen section markers to allow inclusion of sections of code in the Doxygen docs.

Running Unit Tests

If you built AqNWB with the dev mode preset, then simply call:

ctest --preset=dev

Alternatively go to your build directory and run ctest directly, e.g.:

cd <my_build_dir>
ctest

Spellcheck

AqNWB uses codespell to check the code for spelling errors. You can run the spellchecker via:

cmake --build --preset=dev --target=spell-check

To automatically fix spelling errors you can run codespell via the spell-fix target instead:

cmake --build --preset=dev --target=spell-fix
Note
codespell uses a relatively small dictionary of common misspellings and their corrections. For more comprehensive spellchecking (in particular of the documentation) additional spellchecking via more detailed spellcheckers (e.g., aspell) is recommended.

Linting

AqNWB uses clang-format for linting the code. You can run the linter via:

cmake --build --preset=dev --target=format-check

To automatically fix formatting errors you can run the linter via the format-fix target instead:

cmake --build --preset=dev --target=format-fix