Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Data Driven Test row name
QtWS25 Last Chance

Qt Data Driven Test row name

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtestlibqt5.6datatest
6 Posts 3 Posters 3.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    diredko
    wrote on last edited by diredko
    #1

    Hi everyone,
    I'm trying to implement several data driven tests for my Qt Application and I need to get data row name (the string passed as an argument to newRow function) but it seems to be trickier than just doing QFETCH(QString, name).
    I have looked through Qt documentation but couldn't have found anything that could help.
    Would someone please help me understand how name of data row can be fetched in test function?

    Many thanks,
    Dmytro

    p.s. I'm using Qt 5.6

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Out of curiosity, why do you need that information ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Out of curiosity, why do you need that information ?

        D Offline
        D Offline
        diredko
        wrote on last edited by
        #3

        @SGaist I need to implement output messages on test failure with specific format

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Did you saw that you can already get the output of QTest base unit test in different formats ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • Paul ColbyP Offline
            Paul ColbyP Offline
            Paul Colby
            wrote on last edited by
            #5

            Hi @diredko,

            The string passed to QTest::newRow is called the dataTag, and can be accessed via QTest::currentDataTag.

            I hope that helps :)

            pc.

            1 Reply Last reply
            1
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Nice one ! I've missed that function. Thanks !

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved