PDA

View Full Version : Qt unit testing using Google Tests



Archa4
10th May 2011, 14:36
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?

Archa4
11th May 2011, 08:06
No advices? At all?

ChrisW67
11th May 2011, 08:35
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 (http://code.google.com/p/googletest/wiki/V1_6_Documentation)


Are you sure you weren't told to use QTest?

Archa4
11th May 2011, 09:11
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...

high_flyer
11th May 2011, 10:35
http://doc.qt.nokia.com/latest/qtestlib-manual.html