Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unit testing in C++

I've been reading a lot about Unit tests and Test Driven developemnt.

Recently, I also read java unit test code.

I however, prefer to develop in Qt. So I googled up "unit testing in c++" and found a host of information about various unit testing frameworks available for C++.

However, I could not find a reliable comparison of the the various frameworks.

So I look to the SO community to guide me through the selection of what may the "best" unit testing framework for c++.

Also, if anybody had specific comments regarding TDD in Qt (especially using Qt-Creator), then they are more than welcome.

like image 431
jrharshath Avatar asked May 27 '09 04:05

jrharshath


2 Answers

Usually use Boost, but if you are using Qt, their QtTestLib might be the better choice.

like image 170
stephan Avatar answered Oct 24 '22 00:10

stephan


I would recommend doctest (created by me) - it's the lightest on compile times from all the popular testing frameworks. It is also a direct competitor to Catch which is currently the most used framework - checkout the differences in the FAQ

like image 5
onqtam Avatar answered Oct 24 '22 00:10

onqtam