Skip to content
 
 

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CUnit integration for CMake

This is a simple little project attempts to make writing unit tests in C with CUnit as easy as writing unit tests in C with Criterion. The benefit of using CUnit over Criterion is that tests can be run on embedded targets.

CMake is used to preprocess the every source file specified when defining a new test executable. It searches through the files looking for the signatures: CU_Init, CU_Clean, CU_Test and CU_Theory. When any of those signatures is found the necessary actions are taken. When all files have been scanned, a runner is generated that can be used to execute the tests.

A little demo is included. To build it, run the following commands.

cd cmake-cunit
mkdir build
cd build
cmake ..
./demo

About

Easily write CUnit based unit tests for CMake based projects

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages