Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Unit Testing Libraries [closed]

Tags:

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++?

like image 792
Mr. Boy Avatar asked Jan 10 '10 21:01

Mr. Boy


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.

What is the best unit test framework for C?

The most scalable way to write unit tests in C is using a unit testing framework, such as: CppUTest. Unity. Google Test.

Is unit testing still used?

Unit tests are also especially useful when it comes to refactoring or re-writing a piece a code. If you have good unit tests coverage, you can refactor with confidence. Without unit tests, it is often hard to ensure the you didn't break anything.

Does Google test support C?

Google test, or gtest is an open source framework for unit testing C\C++ projects.


1 Answers

There is no standard unit testing library for C++. There are many choices to choose from; cppunit being one of them.

At my company we use Google Test along with its partner Google Mock for unit testing and object mocking. I find them both combined easier to use and much more powerful than cppunit.

like image 95
Grant Limberg Avatar answered Oct 20 '22 16:10

Grant Limberg