Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Qt-Creator have support for Unit Tests?

I started off using Qt-Creator to try out programming qt, but i've also noticed that its a very good IDE for coding in C and C++.

Over the past few months I have been trying out and noticing the benefits of test-driven development when programming in Python through these of frameworks like nose which is supported in the pycharm IDE.

Does C++ and C have an equivalent test framework that can be used in Qt Creator? If not, is there some other IDE I can try that supports the same (or similar) integration that pycharm offers?

like image 328
Michael Aquilina Avatar asked Sep 19 '13 20:09

Michael Aquilina


2 Answers

Yes, it does. You can read about how to make unit tests on QT using their QTestLib tutorial.

If you want a framework that doesn't require the use of Qt libraries, you can use googletest, which is a Google's framework and run under many enviroments (like mLinux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian - taken from googletest docs)

Also, if you want to know about more C++ Unit Testing frameworks, you can take a look at the wikipedia page. There are plenty of options over there.

like image 100
Natan Streppel Avatar answered Oct 16 '22 00:10

Natan Streppel


there is library QTestLib.

Citing from QtCreator documentation:

The QTestLib framework, provided by Nokia, is a tool for unit testing Qt based applications and libraries. QTestLib provides all the functionality commonly found in unit testing frameworks as well as extensions for testing graphical user interfaces.

I'm still using 4.8 on Linux....

like image 23
CapelliC Avatar answered Oct 15 '22 23:10

CapelliC