Git Product home page Git Product logo

Comments (6)

claremacrae avatar claremacrae commented on May 26, 2024

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.

dmsteck avatar dmsteck commented on May 26, 2024

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 to Catch.hpp
    • note how the original Catch2 single header is a lowercase catch.hpp

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.

claremacrae avatar claremacrae commented on May 26, 2024

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.

claremacrae avatar claremacrae commented on May 26, 2024

This will be fixed in v7.0.0 - so closing now

from approvaltests.cpp.

claremacrae avatar claremacrae commented on May 26, 2024

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.

dmsteck avatar dmsteck commented on May 26, 2024

I approve! 😉

from approvaltests.cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.