Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a C++ unit testing library that is similar to NUnit?

We need to migrate a unit test harness developed with C# and NUnit to C++ running on Red Hat Linux.

We want to minimize the efforts in migration.

We are reading resources such as this:

http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle

But we don't see anything similar to NUnit.

like image 222
A-K Avatar asked Sep 10 '09 19:09

A-K


People also ask

Does C have unit testing?

A Unit Testing Framework for CCUnit is a lightweight system for writing, administering, and running unit tests in C. It provides C programmers a basic testing functionality with a flexible variety of user interfaces.

Which one is better NUnit or xUnit?

MSTest is concerned, the biggest difference between xUnit and the other two test frameworks (NUnit and MSTest) is that xUnit is much more extensible when compared to NUnit and MSTest. The [Fact] attribute is used instead of the [Test] attribute.

What is the difference between NUnit and MOQ?

NUnit is a unit testing framework for . NET languages, and Moq is the most popular mocking framework for . NET. I assume the reader is familiar with C# projects, Visual Studio IDE, and the Nuget package manager for managing dependencies.

What is xUnit and NUnit in C#?

NUnit is the C# version of JUnit (Java). xUnit is an improvement of NUnit to make this more extensible for TDD. So is not the name of the tool, they are different tools. – Frank. Sep 20, 2021 at 0:27.


3 Answers

Have You considered using CppUnit?

Here is an overview on unit testing frameworks for C++.

like image 123
The Chairman Avatar answered Sep 24 '22 07:09

The Chairman


We use Google Mock and Google Test. Having never used NUnit, though, I can't comment on how similar it is to NUnit.

like image 41
Grant Limberg Avatar answered Sep 23 '22 07:09

Grant Limberg


And there's Boost.Test.

like image 36
Max Lybbert Avatar answered Sep 24 '22 07:09

Max Lybbert