Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Showcase
  4. Unit testing with Qt Test - tutorial series
Forum Updated to NodeBB v4.3 + New Features

Unit testing with Qt Test - tutorial series

Scheduled Pinned Locked Moved Showcase
17 Posts 11 Posters 8.0k Views 4 Watching
  • 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.
  • P Paul Thexton

    Hi,

    I wish I'd found this tutorial a few days ago when I started looking at some (Basic) unit testing using Qt!

    On the subject of feeding Qt Test results in to other systems, I've been doing that to get the results in to TFS/VSTS (it's what we're using at work, it's non-negotiable) and I've found that the xunitxml support in Qt is actually xunit v1, whereas VSTS/TFS only supports xunit v2 xml.

    I've put together an XSL stylesheet to do the transformation for me, but really it's a pretty clunky way around the problem and I'd much prefer the test runner logs directly to a suitable format.

    Where would be the best place to suggest updating it (or adding an additional format)? Alternatively I'd be happy to submit code to update this via open source, but I'm not sure where to start looking for how to contribute code!

    I'll look forward to reading your following blogs :)

    V Offline
    V Offline
    vivaladav
    wrote on last edited by
    #8

    @Paul-Thexton hey Paul,

    I am not a Qt developer, but to the best of my knowledge you could create a feature request in the Qt bug tracker or you can submit a patch using Gerrit.

    Let us know how it goes :)

    Davide Coppola
    blog | Linkedin | Twitter

    aha_1980A 1 Reply Last reply
    5
    • V vivaladav

      @Paul-Thexton hey Paul,

      I am not a Qt developer, but to the best of my knowledge you could create a feature request in the Qt bug tracker or you can submit a patch using Gerrit.

      Let us know how it goes :)

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #9

      @vivaladav said in Unit testing with Qt Test - tutorial series:

      @Paul-Thexton hey Paul,

      I am not a Qt developer, but to the best of my knowledge you could create a feature request in the Qt bug tracker or you can submit a patch using Gerrit.

      Let us know how it goes :)

      Your knowledge is correct :)

      @Paul-Thexton I think such a contribution would be very helpful for others also.

      Qt has to stay free or it will die.

      1 Reply Last reply
      3
      • V Offline
        V Offline
        vivaladav
        wrote on last edited by
        #10

        Happy new year!

        I have just published the third tutorial: GUI unit testing with Qt Test – part 1 – introduction

        In this tutorial I will introduce GUI unit testing with Qt Test, the Qt framework for C++ unit testing. In particular I will discuss how to write a basic unit test for a widget class, how to simulate mouse and keyboard events and how to write data driven tests.

        Any feedback and questions always welcome.

        Davide Coppola
        blog | Linkedin | Twitter

        1 Reply Last reply
        3
        • P Paul Thexton

          Hi,

          I wish I'd found this tutorial a few days ago when I started looking at some (Basic) unit testing using Qt!

          On the subject of feeding Qt Test results in to other systems, I've been doing that to get the results in to TFS/VSTS (it's what we're using at work, it's non-negotiable) and I've found that the xunitxml support in Qt is actually xunit v1, whereas VSTS/TFS only supports xunit v2 xml.

          I've put together an XSL stylesheet to do the transformation for me, but really it's a pretty clunky way around the problem and I'd much prefer the test runner logs directly to a suitable format.

          Where would be the best place to suggest updating it (or adding an additional format)? Alternatively I'd be happy to submit code to update this via open source, but I'm not sure where to start looking for how to contribute code!

          I'll look forward to reading your following blogs :)

          J Offline
          J Offline
          JulienMaille
          wrote on last edited by
          #11

          @Paul-Thexton said in Unit testing with Qt Test - tutorial series:

          Hi,

          I wish I'd found this tutorial a few days ago when I started looking at some (Basic) unit testing using Qt!

          On the subject of feeding Qt Test results in to other systems, I've been doing that to get the results in to TFS/VSTS (it's what we're using at work, it's non-negotiable) and I've found that the xunitxml support in Qt is actually xunit v1, whereas VSTS/TFS only supports xunit v2 xml.

          I've put together an XSL stylesheet to do the transformation for me, but really it's a pretty clunky way around the problem and I'd much prefer the test runner logs directly to a suitable format.

          Where would be the best place to suggest updating it (or adding an additional format)? Alternatively I'd be happy to submit code to update this via open source, but I'm not sure where to start looking for how to contribute code!

          I'll look forward to reading your following blogs :)

          I see you work with VSTS, which is also what we have at work. Were you able to setup automatic build on VSTS (ie handle all qt depencies required to compile on the online "agent") ?

          P 1 Reply Last reply
          1
          • C Offline
            C Offline
            Charlie_Hdz
            wrote on last edited by
            #12

            Wonderful!

            Kind Regards,
            Enrique Hernandez
            gearstech.com.mx
            chernandez@gearstech.com.mx

            1 Reply Last reply
            1
            • V Offline
              V Offline
              vivaladav
              wrote on last edited by
              #13

              Finally I published the 4th and final part of this series: GUI unit testing with Qt Test – part 2 – advanced testing

              This tutorial will introduce more advanced features of Qt Test dedicated to GUI unit testing. In particular it will show how to simulate and handle keyboard focus and how to test Qt signals when unit testing a Graphical User Interface.

              Any feedback and questions always welcome.

              Davide Coppola
              blog | Linkedin | Twitter

              1 Reply Last reply
              4
              • J JulienMaille

                @Paul-Thexton said in Unit testing with Qt Test - tutorial series:

                Hi,

                I wish I'd found this tutorial a few days ago when I started looking at some (Basic) unit testing using Qt!

                On the subject of feeding Qt Test results in to other systems, I've been doing that to get the results in to TFS/VSTS (it's what we're using at work, it's non-negotiable) and I've found that the xunitxml support in Qt is actually xunit v1, whereas VSTS/TFS only supports xunit v2 xml.

                I've put together an XSL stylesheet to do the transformation for me, but really it's a pretty clunky way around the problem and I'd much prefer the test runner logs directly to a suitable format.

                Where would be the best place to suggest updating it (or adding an additional format)? Alternatively I'd be happy to submit code to update this via open source, but I'm not sure where to start looking for how to contribute code!

                I'll look forward to reading your following blogs :)

                I see you work with VSTS, which is also what we have at work. Were you able to setup automatic build on VSTS (ie handle all qt depencies required to compile on the online "agent") ?

                P Offline
                P Offline
                Paul Thexton
                wrote on last edited by
                #14

                @JulienMaille apologies, I didn't get a notification about your message. As far as I know you're probably not going to be able to use the Microsoft 'Hosted' build agents for building Qt projects, I created my own build agent on a Linux VM.

                1 Reply Last reply
                0
                • owenlevineeO Offline
                  owenlevineeO Offline
                  owenlevinee
                  Banned
                  wrote on last edited by
                  #15
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    david_wang
                    wrote on last edited by
                    #16

                    OH MAN ! This is exactly what I want!
                    I am looking for how to run all Unit testing at one time (part2)

                    This is really helpful.

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      Tayyab3
                      Banned
                      wrote on last edited by
                      #17
                      This post is deleted!
                      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