How To Install libtest-base-perl on Ubuntu 18.04

In this tutorial we learn how to install libtest-base-perl on Ubuntu 18.04. libtest-base-perl is data driven testing framework for Perl

Introduction

In this tutorial we learn how to install libtest-base-perl on Ubuntu 18.04.

What is libtest-base-perl

libtest-base-perl is:

Testing is usually the ugly part of Perl module authoring. Perl gives you a standard way to run tests with Test::Harness, and basic testing primitives with Test::More. After that you are pretty much on your own to develop a testing framework and philosophy. Test::More encourages you to make your own framework by subclassing Test::Builder, but that is not trivial.

Test::Base gives you a way to write your own test framework base class that is trivial. In fact it is as simple as two lines: package MyTestFramework; use Test::Base -Base;

A module called MyTestFramework.pm containing those two lines, will give all the power of Test::More and all the power of Test::Base to every test file that uses it. As you build up the capabilities of MyTestFramework, your tests will have all of that power as well.

MyTestFramework becomes a place for you to put all of your reusable testing bits. As you write tests, you will see patterns and duplication, and you can “upstream” them into MyTestFramework. Of course, you don’t have to subclass Test::Base at all. You can use it directly in many applications, including everywhere you would use Test::More.

Test::Base concentrates on offering reusable data driven patterns, so that you can write tests with a minimum of code. At the heart of all testing you have inputs, processes and expected outputs. Test::Base provides some clean ways for you to express your input and expected output data, so you can spend your time focusing on that rather than your code scaffolding.

There are three methods to install libtest-base-perl on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libtest-base-perl Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libtest-base-perl using apt-get by running the following command:

sudo apt-get -y install libtest-base-perl

Install libtest-base-perl Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libtest-base-perl using apt by running the following command:

sudo apt -y install libtest-base-perl

Install libtest-base-perl Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libtest-base-perl using aptitude by running the following command:

sudo aptitude -y install libtest-base-perl

How To Uninstall libtest-base-perl on Ubuntu 18.04

To uninstall only the libtest-base-perl package we can use the following command:

sudo apt-get remove libtest-base-perl

Uninstall libtest-base-perl And Its Dependencies

To uninstall libtest-base-perl and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove libtest-base-perl

Remove libtest-base-perl Configurations and Data

To remove libtest-base-perl configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge libtest-base-perl

Remove libtest-base-perl configuration, data, and all of its dependencies

We can use the following command to remove libtest-base-perl configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libtest-base-perl

References

Summary

In this tutorial we learn how to install libtest-base-perl package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.