Results 1 to 5 of 5

Thread: Qt unit testing using Google Tests

  1. #1
    Join Date
    Feb 2011
    Location
    Latvia
    Posts
    139
    Thanks
    24
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt unit testing using Google Tests

    I have to test my program and I was advised to use Google Test. I have downloaded a file from google test page called gtest-1.6.0. It contains many folders and some files.
    I have no idea what I should do next... Can anyone give an advice? I read that I have to "Compile Google Test into a library". How can I do that (I use MinGW32)?
    And another trouble - Where can i read a manual about how to write the tests for my app?

  2. #2
    Join Date
    Feb 2011
    Location
    Latvia
    Posts
    139
    Thanks
    24
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt unit testing using Google Tests

    No advices? At all?

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt unit testing using Google Tests

    You are asking in a Qt forum how to build and use Google Test. Did you expect to be flooded with answers?

    You start by reading the invitingly named README file in the gtest zip file. The first thing that you will note is the absence MingW in the list of build environments. Doesn't mean it won't work but you might need a full MSys environment. Look for the CMake instructions; this is probably your best bet.

    Then you read the Google Test Docs


    Are you sure you weren't told to use QTest?
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  4. #4
    Join Date
    Feb 2011
    Location
    Latvia
    Posts
    139
    Thanks
    24
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt unit testing using Google Tests

    Well... I was going to use QTest, but then i was told, that Google Test is the better way to test.
    But I think I can convince them that QTest is the way to do that, but then, can you redirect me to some documentation (preferably step-by-step) how to create those test?
    For example have i to create new class in my project, or do I create new project, and how to link these tests, so I could test my classes...
    Last edited by Archa4; 11th May 2011 at 09:15.

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qt unit testing using Google Tests

    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 3
    Last Post: 11th November 2012, 21:17
  2. UNit Testing
    By Qt_Kid in forum Newbie
    Replies: 2
    Last Post: 3rd May 2011, 09:26
  3. How to do Unit testing
    By Qt_Kid in forum Newbie
    Replies: 4
    Last Post: 30th March 2011, 00:49
  4. Qt unit testing
    By chandan in forum Newbie
    Replies: 3
    Last Post: 13th July 2010, 19:20
  5. Unit tests
    By leoalvesmachado in forum Newbie
    Replies: 1
    Last Post: 13th April 2010, 20:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.