How To Install shunit2 on Fedora 36

In this tutorial we learn how to install shunit2 in Fedora 36. shunit2 is A xUnit based unit testing for Unix shell scripts

Introduction

In this tutorial we learn how to install shunit2 on Fedora 36.

What is shunit2

shUnit2 is a xUnit unit test framework for Bourne based shell scripts, and it is designed to work in a similar manner to JUnit, PyUnit, etc. If you have ever had the desire to write a unit test for a shell script, shUnit2 can do the job.

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

Install shunit2 on Fedora 36 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install shunit2

Install shunit2 on Fedora 36 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install shunit2

How To Uninstall shunit2 on Fedora 36

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

sudo dnf remove shunit2

shunit2 Package Contents on Fedora 36

/usr/share/doc/shunit2
/usr/share/doc/shunit2/CHANGES-2.1.txt
/usr/share/doc/shunit2/LGPL-2.1
/usr/share/doc/shunit2/README.txt
/usr/share/doc/shunit2/RELEASE_NOTES-2.1.6.txt
/usr/share/doc/shunit2/TODO.txt
/usr/share/doc/shunit2/coding_standards.txt
/usr/share/doc/shunit2/contributors.txt
/usr/share/doc/shunit2/design_doc.txt
/usr/share/doc/shunit2/examples
/usr/share/doc/shunit2/examples/equality_test.sh
/usr/share/doc/shunit2/examples/lineno_test.sh
/usr/share/doc/shunit2/examples/math.inc
/usr/share/doc/shunit2/examples/math_test.sh
/usr/share/doc/shunit2/examples/mkdir_test.sh
/usr/share/doc/shunit2/examples/party_test.sh
/usr/share/doc/shunit2/shunit2.txt
/usr/share/shunit2
/usr/share/shunit2/shunit2
/usr/share/shunit2/shunit2_test_helpers

References

Summary

In this tutorial we learn how to install shunit2 on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).