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 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 :)

    jsulmJ 1 Reply Last reply
    0
    • V vdevadass

      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 :)

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #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 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.

        jsulmJ 1 Reply Last reply
        0
        • V vdevadass

          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.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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
          2
          • jsulmJ jsulm

            @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 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.

            jsulmJ 1 Reply Last reply
            0
            • V vdevadass

              @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.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on 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

              • Login

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