How To Install shunit2 on Fedora 34

shunit2 is A xUnit based unit testing for Unix shell scripts

Introduction

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

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 34. In this tutorial we discuss both methods but you only need to choose one of method to install shunit2.

Install shunit2 on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

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

sudo dnf -y install shunit2

Install shunit2 on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

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 34

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

sudo dnf remove shunit2

shunit2 Package Contents on Fedora 34

/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 34 using yum and dnf.