What do you use to unit test your C ++ code?

I am exploring some possible unit testing options for C ++ classes.

So, shortly and accurately, what are you using?

+3
source share
7 answers

I am using cppunit . This is a pretty good iconic JUnit port for C ++.

+4
source

UnitTest ++ . I used to use the Boost Test, which is also pretty good, but I ran into a problem when the boost test wanted the <<operator and it would not accept my overloaded <operator. UnitTest ++ didn’t flinch a bit.

+2
source
+2

CxxTest, Perl script test*. , Perl /.

+2

Boost.Test. boost, , , .

+2

, lib/DLL assert.

: , , .

, () .

It has some drawbacks: firstly, you do not have an automatic visual check that was checked, but this can be fixed using the print instruction. You will not receive a list of failed tests. In addition, compared to any environment that supports reflection, the added value of unit test frames seems a little lower to me. And better than no unit tests at all.

0
source

Take a look at CUnitWin32 . It includes an example.

0
source

Source: https://habr.com/ru/post/1698683/


All Articles