Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unit testing framework for C [closed]

Tags:

c

Is there any unit testing framework for C like JUnit and Nunit for java and .NET? Or how do we test a piece of code written in C for different scenarios?

Thanks in advance......

like image 260
Vineel Kumar Reddy Avatar asked Apr 30 '10 15:04

Vineel Kumar Reddy


People also ask

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.

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 is a unit testing framework?

Advertisements. Unit testing is a software testing method by which individual units of source code, such as functions, methods, and class are tested to determine whether they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application.

Does Google test support C?

GoogleTest requires a codebase and compiler compliant with the C++11 standard or newer.


1 Answers

I have worked some with Check and its very easy to setup. Its used by some big active projects like GStreamer. Here is a simple example of fail if line:

fail_if (0 == get_element_position(spot), "Position should not be 0");
like image 191
tilljoel Avatar answered Oct 12 '22 22:10

tilljoel