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

Update Catch2 #514

Open
otbrown opened this issue Nov 25, 2024 · 2 comments
Open

Update Catch2 #514

otbrown opened this issue Nov 25, 2024 · 2 comments

Comments

@otbrown
Copy link

otbrown commented Nov 25, 2024

QuEST is currently pinned to Catch2 v2.13. The latest release is v3.7.1 so we should at least consider upgrading. I don't particularly want to do this for the v4 release, but it could be in v4.1.

Note that Catch2 v3 is not header-only like v3, so testing won't be self-contained within this repo any longer, so will need approval from @TysonRayJones!

@TysonRayJones
Copy link
Member

Sounds good to me! The old single-header version allowed one to clone QuEST and run the unit tests with "no dependencies", i.e. no user preparation of the Catch2 library (which made for a great live-coding demo). Can we somehow maintain this when using v3+ Catch2? Would we have to submodule Catch2 into the QuEST repo?

(Note it's a minor chore to suppress duplicated Catch2 logging when running distributed tests.)

@TysonRayJones
Copy link
Member

Wew I've since learned this can be done with CMake's FetchContent, like the below demo (from the Catch2 doc):

Include(FetchContent)

FetchContent_Declare(
  Catch2
  GIT_REPOSITORY https://github.com/catchorg/Catch2.git
  GIT_TAG        v3.4.0 # or a later release
)

FetchContent_MakeAvailable(Catch2)

add_executable(tests test.cpp)
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain)

Alas I won't be able to effect a patch/diff to avoid duplicated output when running distributed - I'll instead need to write my own reporter 😢 I'll procrastinate that until the tests are all up and working 🎉

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

No branches or pull requests

2 participants