How To Install CUnit on CentOS 8

CUnit is Unit testing framework for C Unit testing framework for C

Introduction

In this tutorial we learn how to install CUnit on CentOS 8.

What is CUnit

CUnit 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. CUnit 2.1.3 17.el8 x86_64 56 k CUnit-2.1.3-17.el8.src.rpm appstream Unit testing framework for C http LGPLv2+ CUnit 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.

We can use yum or dnf to install CUnit on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install CUnit.

Install CUnit on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install CUnit using dnf by running the following command:

sudo dnf -y install CUnit

Install CUnit on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install CUnit using yum by running the following command:

sudo yum -y install CUnit

How To Uninstall CUnit on CentOS 8

To uninstall only the CUnit package we can use the following command:

sudo dnf remove CUnit

CUnit Package Contents on CentOS 8

/usr/lib/.build-id
/usr/lib/.build-id/0f
/usr/lib/.build-id/0f/0bc759871bfb84f8660d06767d13ab2eb07978
/usr/lib64/libcunit.so.1
/usr/lib64/libcunit.so.1.0.1
/usr/share/CUnit
/usr/share/CUnit/CUnit-List.dtd
/usr/share/CUnit/CUnit-List.xsl
/usr/share/CUnit/CUnit-Run.dtd
/usr/share/CUnit/CUnit-Run.xsl
/usr/share/CUnit/Memory-Dump.dtd
/usr/share/CUnit/Memory-Dump.xsl
/usr/share/doc/CUnit
/usr/share/doc/CUnit/AUTHORS
/usr/share/doc/CUnit/COPYING
/usr/share/doc/CUnit/ChangeLog
/usr/share/doc/CUnit/NEWS
/usr/share/doc/CUnit/README
/usr/share/doc/CUnit/TODO
/usr/share/doc/CUnit/VERSION
/usr/lib/.build-id
/usr/lib/.build-id/3d
/usr/lib/.build-id/3d/b365ec56b4aded28f771aa247969c55056aefe
/usr/lib/libcunit.so.1
/usr/lib/libcunit.so.1.0.1
/usr/share/CUnit
/usr/share/CUnit/CUnit-List.dtd
/usr/share/CUnit/CUnit-List.xsl
/usr/share/CUnit/CUnit-Run.dtd
/usr/share/CUnit/CUnit-Run.xsl
/usr/share/CUnit/Memory-Dump.dtd
/usr/share/CUnit/Memory-Dump.xsl
/usr/share/doc/CUnit
/usr/share/doc/CUnit/AUTHORS
/usr/share/doc/CUnit/COPYING
/usr/share/doc/CUnit/ChangeLog
/usr/share/doc/CUnit/NEWS
/usr/share/doc/CUnit/README
/usr/share/doc/CUnit/TODO
/usr/share/doc/CUnit/VERSION

References

Summary

In this tutorial we learn how to install CUnit on CentOS 8 using yum and dnf.