Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which C unit test framework?

I have just began a new C project, using gcc (currently 4.5.2). Now, before it grows too big, I want to start unit testing it. After some googling I've realized that there are numerous of frameworks to choose from. I cannot afford testing them all.

Note that I don't mind using g++ for the unit tests, as long as I can use gcc for the project itself. It won't hurt if it has good VIM integration, though not mandatory.

So, simply, which should I choose and why?

like image 945
Johan Avatar asked Aug 26 '11 17:08

Johan


People also ask

Which unit test framework for C or C++ is popular amongst developers?

The unit test framework for C or C++ popular amongst developers is Embunit. Embunit is an open source unit testing framework which is designed for software application written in C or C++. Embunit is designed as a unit testing tool for both developers and testers for software application written in C or C++.

What is unit testing framework?

Commercial/freeware test framework for unit and integration testing that analyses dependencies between test cases to flow data between them. Supports combinatorial testing, multithreading and time-dependencies. Implement unit tests without coding.

How do I get Started with C++ unit testing?

You can download the Google Test adapter and Boost.Test Adapter extensions on the Visual Studio Marketplace. Find them at Test adapter for Boost.Test and Test adapter for Google Test. The following sections show the basic steps to get you started with C++ unit testing.

What is header only unit testing framework?

Header-only unit testing framework. Multi-platform. Supports running each test in a separate process. Works without needing to "register" test cases. A robust header only unit testing framework, for C and C++. Supports function mocking, memory leak detection, crash report.


1 Answers

I've played with libcheck, which is pretty good. It's been a while since I last used it, but it does the job, and is just straight C.

like image 107
chmeee Avatar answered Oct 02 '22 15:10

chmeee