Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-121556

As a user of QTestLib, I'd like to use Catch2-style hierarchical SCENARIO/GIVEN/WHEN/THEN tests

XMLWordPrintable

    • Icon: User Story User Story
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • None
    • Testing: qtestlib
    • None

      In Catch2, I can share common setup code like this:

      SCENARIO("....") {
          ~~~ setup ~~~~
          GIVEN(".....") {
               ~~~ setup ~~~~
               WHEN("....") {
                   ~~~~ action ~~~~
                   THEN("....") {
                       ~~~~ checks ~~~~
                    }
                }
                ~~~ more WHEN ~~~~
          }
          ~~~~ more GIVEN ~~~~
      }
      ~~~~ more SCENARIOs ~~~~
      

      I'd like to do the same with QTestLib instead of having to write JUnit-like test functions.

      Like in Catch2, these dynamic section should not only be used in error reporting, but also in test subset selection.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            cnn Qt Core & Network
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes