Comments (6)
Hallo @dmsteck - please excuse my memory, but was it you that requested this, and if so, could you add any more info to help us identify a solution please?
from approvaltests.cpp.
Hi @claremacrae, yep that was me. Thanks for remembering.
What you wrote in the OP is true to a certain extent.
However, the Catch2 integration header (ApprovalTests/integrations/catch/Catch2Approvals.h
) includes Catch.hpp
. Hence, to use the Catch2 integration, you actually need Catch.hpp
on your include path. This leaves the user with two possibilities:
- add
third_party/catch2
as an include path, which will pull in the bundled catch2 header; or - have your own
Catch.hpp
header which either "forwards" to wherever your Catch2 single include lies, or copy the Catch2 single-include and rename it toCatch.hpp
- note how the original Catch2 single header is a lowercase
catch.hpp
- note how the original Catch2 single header is a lowercase
I'm not sure what an "elegant" solution would look like here. A simple suggestion that I can come up with would be to rename the Catch.hpp
that ApprovalTests looks for to a lowercase catch.hpp
, so that users can achieve the desired effect by linking against their own copy of Catch2.
PS: The above is only relevant when you import ApprovalTests.cpp
by cloning the repo rather than using the single include. Based on your recent comments it seemed like you intended for people to use the single include?
from approvaltests.cpp.
Hi @dmsteck
That's really helpful - thank you. I'll discuss this with @isidore next time we pair...
I think the best approach would be to rename out Catch.hpp to catch.hpp so it's consistent with what anyone would download directly - I hadn't noticed that inconsistency. We'd want to include that the next time we bump the major version number, I think.
Re single include vs cloning... we originally only ever envisaged this would be used by people downloading the single header...
But we learned that it was going to be used by people cloning it when we had a bug report of pull request to fix our CMake files so that it would work this way - so it would be good to make sure it works well this way too.
Also, because creating the single header requires non-trivial dependencies, that's another reason why some who wanted to fork and modify code in this project would mostly likely include this repo directly - having them generate their own copy of the single header isn't a super-feasible thing to recommend...
from approvaltests.cpp.
This will be fixed in v7.0.0 - so closing now
from approvaltests.cpp.
Hi @dmsteck - just to let you know we released this tonight...
https://github.com/approvals/ApprovalTests.cpp/releases/tag/v.7.0.0
I do hope it helps! Thanks for the feedback.
from approvaltests.cpp.
I approve! 😉
from approvaltests.cpp.
Related Issues (20)
- Add clang12 CI build HOT 1
- Provide a script to allow users to generate the single header from the current code, without doing a release HOT 9
- Add a documentation example showing how to obtain ApprovalTests.cpp via CPM.cmake HOT 1
- Add vcpkg to our release process HOT 2
- Document how to use Approval Tests with vcpkg HOT 1
- Bullet lists not rendered correcting on Read the Docs version of our documentation HOT 3
- Add a copyright statement to the released single header HOT 1
- GitHub Actions: Don't run scheduled tasks on forked repos
- Using kdiff3 as diff tool, user has to specify name of output file after merge
- cygwin CI build hangs for 6 hours then fails HOT 5
- warning C4459 in MSVC with /W4 HOT 1
- Does not compile with clang13 due to -Werror/-Wdeprecated-copy-with-dtor HOT 2
- Ninja + Catch2 + mingw64
- useApprovalsSubdirectory() doesn't create the output directory in the expected location HOT 3
- "Unable to create directory" - unable to run test build with mingw provided by qt-installer HOT 5
- with CppUTest: `ApprovalMismatchException` suppresses other tests output HOT 4
- add `code -d {Received} {Approved}` to Reporters list
- Catch2 integration does not handle Generators inside sections HOT 1
- Catch2 v3 integration HOT 5
- Bug with {fmt} integration HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from approvaltests.cpp.