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

Support for catch2 v3.x.x #219

Closed
Laguna1989 opened this issue Dec 23, 2023 · 2 comments
Closed

Support for catch2 v3.x.x #219

Laguna1989 opened this issue Dec 23, 2023 · 2 comments

Comments

@Laguna1989
Copy link
Collaborator

The catch2 framework was recently upgraded to catch2 v3. The folder structure and files have been changed. There is no header

#include <catch2/catch.hpp>

anymore, but it should be

#include <catch2/catch_test_macros.hpp>

This leads to errors with this line when compiling.

Example output (generated with g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 and cmake version 3.27.7.

FAILED: .../main.cpp.o 
/usr/bin/c++  -I/<project_root>/cmake-build-debug/_deps/rapidcheck-src/extras/catch/include -I/<project_root>/impl/object_lib -I/<project_root>/cmake-build-debug/_deps/rapidcheck-src/include -I/<project_root>/cmake-build-debug/_deps/catch2-src/src/catch2/.. -I/<project_root>/cmake-build-debug/_deps/catch2-build/generated-includes -I/<project_root>/cmake-build-debug/_deps/approvaltests-src/ApprovalTests/.. -I/<project_root>/cmake-build-debug/_deps/approvaltests-src/ApprovalTests -g -fdiagnostics-color=always -MD -MT .../main.cpp.o -MF .../main.cpp.o.d -o .../main.cpp.o -c /<project_root>/test/object_lib_lib_test/main.cpp
In file included from /<project_root>/cmake-build-debug/_deps/approvaltests-src/ApprovalTests/../ApprovalTests/ApprovalTests.hpp:70,
                 from /<project_root>/test/object_lib_lib_test/main.cpp:2:
/<project_root>/cmake-build-debug/_deps/approvaltests-src/ApprovalTests/../ApprovalTests/integrations/catch/Catch2Approvals.h:18:10: fatal error: catch2/catch.hpp: No such file or directory
   18 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
[31/35] Building CXX object _deps/approvaltests-build/ApprovalTests/CMakeFiles/ApprovalTests.dir/reporters/ReporterFactory.cpp.o
ninja: build stopped: subcommand failed.

This is reproducible for the latest tag v.10.12.2 as well as for the current master (d46d190)

@claremacrae
Copy link
Collaborator

Thank you, yes this needs to be done.

We have an earlier report in #156 - and need to figure out how to maintain support for both Catch2 v2 and Catch2 v3.

@Laguna1989
Copy link
Collaborator Author

Fixed with #221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants