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. Unit testing Qt code with CppUTest?

Unit testing Qt code with CppUTest?

Scheduled Pinned Locked Moved Unsolved General and Desktop
cpputestunit test
6 Posts 2 Posters 2.3k 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.
  • V Offline
    V Offline
    vdevadass
    wrote on 10 Nov 2017, 09:03 last edited by
    #1

    Hi all,
    How to run cpputest on qt code? I'm unable to find much help on this online, a detailed description would help.

    Thanks :)

    J 1 Reply Last reply 10 Nov 2017, 09:46
    0
    • V vdevadass
      10 Nov 2017, 09:03

      Hi all,
      How to run cpputest on qt code? I'm unable to find much help on this online, a detailed description would help.

      Thanks :)

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 10 Nov 2017, 09:46 last edited by jsulm 11 Oct 2017, 09:50
      #2

      @vdevadass "qt code" is simply C++ code, so you use it like shown here http://cpputest.github.io/.
      By the way: why don't you use http://doc.qt.io/qt-5/qtest-overview.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • V Offline
        V Offline
        vdevadass
        wrote on 10 Nov 2017, 10:34 last edited by
        #3

        yes i get qt code is c++ code but cpputest needs to understand all the data structures/types and functions part of QT, and QT framework. Hence, wouldn't i need to include some qt libraries in cpputest for it compile qt code?

        For the project, we are using cpputest as standard, hence looking for a way to test qt using the same, otherwise i would have fallback to qtest.

        J 1 Reply Last reply 10 Nov 2017, 12:08
        0
        • V vdevadass
          10 Nov 2017, 10:34

          yes i get qt code is c++ code but cpputest needs to understand all the data structures/types and functions part of QT, and QT framework. Hence, wouldn't i need to include some qt libraries in cpputest for it compile qt code?

          For the project, we are using cpputest as standard, hence looking for a way to test qt using the same, otherwise i would have fallback to qtest.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 10 Nov 2017, 12:08 last edited by
          #4

          @vdevadass said in Unit testing Qt code with CppUTest?:

          wouldn't i need to include some qt libraries in cpputest for it compile qt code?

          Yes, you need to do this like with any other Qt project - include needed Qt header files and link against needed Qt libraries.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          V 1 Reply Last reply 10 Nov 2017, 15:17
          2
          • J jsulm
            10 Nov 2017, 12:08

            @vdevadass said in Unit testing Qt code with CppUTest?:

            wouldn't i need to include some qt libraries in cpputest for it compile qt code?

            Yes, you need to do this like with any other Qt project - include needed Qt header files and link against needed Qt libraries.

            V Offline
            V Offline
            vdevadass
            wrote on 10 Nov 2017, 15:17 last edited by
            #5

            @jsulm said in Unit testing Qt code with CppUTest?:

            Yes, you need to do this like with any other Qt project - include needed Qt header files and link against needed Qt libraries.

            Can you please provide more details on including header files and linking Qt libraries? this is my first time using Qt.

            J 1 Reply Last reply 13 Nov 2017, 05:23
            0
            • V vdevadass
              10 Nov 2017, 15:17

              @jsulm said in Unit testing Qt code with CppUTest?:

              Yes, you need to do this like with any other Qt project - include needed Qt header files and link against needed Qt libraries.

              Can you please provide more details on including header files and linking Qt libraries? this is my first time using Qt.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 13 Nov 2017, 05:23 last edited by
              #6

              @vdevadass Please take a look here to see how to use INCLUDEPATH and LIBS libraries in pro file: http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2

              6/6

              13 Nov 2017, 05:23

              • Login

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