Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-25582

Catch2 v3.0 headers not detected in projects

    XMLWordPrintable

Details

    • All
    • d7c659fa87e8052b25bff98c8c127ae1bc34753e (qt-creator/qt-creator/4.15)

    Description

      Catch2 is transitioning to a 3.0 release, and the changes break compatibility with Qt's Test integration. Specifically, the current implementation searches for an inclusion of "catch.hpp" for test detection here:

      https://github.com/qt-creator/qt-creator/blob/0be9639e6f4f7c9713b8fee32281225ab72e22fb/src/plugins/autotest/catch/catchtestparser.cpp#L69

      In the 3.0 branch (now the default branch), the headers have been split to help Catch2 compile times. As a result, the catch.hpp header no longer exists in that branch. This has been replaced with several other possible headers: "catch2/catch_all.hpp", "catch2/catch_test_macros.hpp", and "catch2/catch_template_test_macros.hpp"

      I suggest replacing the search on the line I linked above with a search for any of catch.hpp (for backward compatibility), catch_all.hpp, catch_test_macros.hpp, and catch_template_test_macros.hpp.

       

      P.S.: For others that may crave a workaround in the meantime: you can force the current version to work with a minor kludge: make a symlink named catch.hpp pointing to catch_all.hpp, and then include that in your test source. It's not pretty, but it gets Qt to detect it until the above is implemented.

       

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-25582
        # Subject Branch Project Status CR V

        Activity

          People

            cstenger Christian Stenger
            viravera Bob Miller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes