How To Install perl-Test-Warnings on CentOS 7

In this tutorial we learn how to install perl-Test-Warnings on CentOS 7. perl-Test-Warnings is Test for warnings and the lack of them

Introduction

In this tutorial we learn how to install perl-Test-Warnings on CentOS 7.

What is perl-Test-Warnings

If you’ve ever tried to use Test no warnings generated by your tests, combined with the convenience of done_testing to not have to declare a test count, you’ll have discovered that these two features do not play well together, as the test count will be calculated before the warnings test is run, resulting in a TAP error (see examples/test_nowarnings.pl in this distribution for a demonstration). This module is intended to be used as a drop-in replacement for Test before done_testing calculates the test count, rather than after. It does this by hooking into done_testing as well as via an END block. You can declare a plan, or not, and things will still Just Work. It is actually equivalent to use Test as warnings are still printed normally as they occur. You are safe, and enthusiastically encouraged, to perform a global search-replace of the above with use Test not your tests have a plan.

We can use yum or dnf to install perl-Test-Warnings on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install perl-Test-Warnings.

Install perl-Test-Warnings on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install perl-Test-Warnings using yum by running the following command:

sudo yum -y install perl-Test-Warnings

Install perl-Test-Warnings on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install perl-Test-Warnings using dnf by running the following command:

sudo dnf -y install perl-Test-Warnings

How To Uninstall perl-Test-Warnings on CentOS 7

To uninstall only the perl-Test-Warnings package we can use the following command:

sudo dnf remove perl-Test-Warnings

References

Summary

In this tutorial we learn how to install perl-Test-Warnings on CentOS 7 using yum and dnf.