Questions tagged [cppunit]

CppUnit is a macro-based unit testing framework for C++.

CppUnit is a macro-based unit testing framework for C++.

259 questions
335
votes
9 answers

Comparison of C++ unit test frameworks

I know there are already a few questions regarding recommendations for C++ unit test frameworks, but all the answers did not help as they just recommend one of the frameworks but do not provide any information about a (feature) comparison. I think…
housemaister
  • 3,918
  • 3
  • 19
  • 13
74
votes
3 answers

GoogleTest vs CppUnit: The facts

In the process of setting our C++ unit testing framework for the next years we shortlisted GoogleTest and CppUnit. I have some experience with both and my heavy preference is GoogleTest. Anyways to convince my boss I need some facts so I did some…
EstuansInterius
  • 849
  • 1
  • 7
  • 5
24
votes
1 answer

CppUnit output to TAP format converter

I seek a perl module to convert CppUnit output to TAP format. I want to use the prove command afterwards to run and check the tests.
Oleg Razgulyaev
  • 5,757
  • 4
  • 28
  • 28
23
votes
3 answers

Test Driven Development with C++

Looking to start doing TDD in C++. I've seen CPPUnit, but I was wondering if there are other options that people prefer? Thanks for your suggestions!
hwrd
  • 2,134
  • 6
  • 29
  • 36
23
votes
2 answers

Why does Google Mocks find this function call ambiguous?

I've run into an issue while attempting to start using Google Mocks - for some reason it can't tell the call I'm specifying in the EXPECT_CALL macro, even though the types are consistent. I want to know why it doesn't just match the first function,…
dlanod
  • 8,664
  • 8
  • 54
  • 96
21
votes
5 answers

How can I measure CppUnit test coverage (on win32 and Unix)?

I have a very large code base that contains extensive unit tests (using CppUnit). I need to work out what percentage of the code is exercised by these tests, and (ideally) generate some sort of report that tells me on a per-library or per-file…
Thomi
  • 11,647
  • 13
  • 72
  • 110
21
votes
8 answers

C++ Unit Testing Libraries

I've come across cppunit but it didn't look super-easy to use (maybe I didn't look hard, maybe because C++ doesn't work like Java/C#). Are there widely used, simple alternatives? In fact, is cppunit the standard unit testing framework for C++?
Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
19
votes
7 answers

Unit testing destructors?

Is there any good way to unit test destructors? Like say I have a class like this (contrived) example: class X { private: int *x; public: X() { x = new int; } ~X() { delete x; } int *getX()…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
14
votes
2 answers

boost.test vs. CppUnit

I've been using CppUnit for quite a while now (and am happy with it). As we are using more and more parts of the boost library I had a short look on boost.test and I'm wondering now if I should switch to boost.test in a new project or not. Can…
chrmue
  • 1,552
  • 2
  • 18
  • 35
13
votes
2 answers

A multi-thread implementation of CppUnit?

Could someone point me to a version of CppUnit that would allow to launch the tests in separate threads? The idea is that, because many of our tests are quite CPU heavy (but are not multi-thread and, of course, are independant one from the other),…
Xavier Nodet
  • 5,033
  • 2
  • 37
  • 48
10
votes
2 answers

How to use inheritance for a class with TEST_CLASS in CppUnitTestFramework

I've got a class that inherits from another class like so: class TestClass : public BaseClass I am wondering if it is possible to make this a test class using the TEST_CLASS macro or some other macro that is part of the Microsoft Unit Testing…
10
votes
2 answers

Install latest cppunit in windows

I am trying to install CppUnit on Windows. I have downloaded it from here, decompressed it, and noticed that all files have ,v in their name, and no extension. The instructions for installation (in included files, as well as on every site I found…
Thalia
  • 13,637
  • 22
  • 96
  • 190
9
votes
6 answers

macro `AM_PATH_CPPUNIT' not found in library

I am trying to build libtorrent on shared hosting. So built CPPUnit(1.12.1) with --prefix=$HOME. After that my $HOME/lib and $HOME/include contains CPPUnit libraries and headers. The I exported LD_ paths export…
Pablo
  • 28,133
  • 34
  • 125
  • 215
9
votes
3 answers

Testing static functions with CppUnit

My project contains C files. And in some files I have functions defined as static. I'm using CppUnit in my unit tests and I want to test these static functions. I know that calling a function from outside the file (where it's defined) is not…
MOHAMED
  • 41,599
  • 58
  • 163
  • 268
8
votes
8 answers

Parameterizing a test using CppUnit

My organization is using CppUnit and I am trying to run the same test using different parameters. Running a loop inside the test is not a good option as any failure will abort the test. I have looked at TestDecorator and TestCaller but neither seems…
Harald Scheirich
  • 9,676
  • 29
  • 53
1
2 3
17 18