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

Configure CTest #33

Merged
merged 21 commits into from
Dec 19, 2024
Merged

Configure CTest #33

merged 21 commits into from
Dec 19, 2024

Conversation

mrossinek
Copy link
Collaborator

@mrossinek mrossinek commented Dec 17, 2024

This updates the C testing configuration to become a CMake/CTest build.

Key features are as follows:

  • files matching test/c/test_*.c are autodetected as tests
  • every such fail must contain one function which has the same name as the filename without extension
  • make c-test will build a test runner collecting all of the tests above in test/c/build and execute those tests

Notes:

  • the required match between the filename and test function is a caveat of this method 1. Alternatively, we must specify each test individually inside test/c/CMakeLists.txt
  • I still need to figure out how to get find_library to work (see comment in test/c/CMakeLists.txt)
  • test what happens when individual subtests fail and what that looks like from the CLI
  • currently, test/c/test_main2.c is a copy of test/c/test_main.c to prototype the glob. We should make this more sensible as we develop the C API. We could do a recursive glob if we want to write multiple test files e.g. inside test/c/sparse_observable/test_*.c. Happy to discuss this.

Base automatically changed from c-api to c-sparse-observable December 17, 2024 10:39
@mrossinek mrossinek marked this pull request as ready for review December 18, 2024 17:03
@Cryoris Cryoris merged commit 1058c20 into c-sparse-observable Dec 19, 2024
6 checks passed
@Cryoris Cryoris deleted the ctest branch December 19, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants