How To Install gmock on Rocky Linux 8

In this tutorial we learn how to install gmock on Rocky Linux 8. gmock is Google C++ Mocking Framework

Introduction

In this tutorial we learn how to install gmock on Rocky Linux 8.

What is gmock

Inspired by jMock, EasyMock, and Hamcrest, and designed with C++s specifics in mind, Google C++ Mocking Framework (or Google Mock for short) is a library for writing and using C++ mock classes. Google Mock o lets you create mock classes trivially using simple macros, o supports a rich set of matchers and actions, o handles unordered, partially ordered, or completely ordered expectations, o is extensible by users, and o works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and Symbian.

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

Install gmock on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install gmock

Install gmock on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install gmock

How To Uninstall gmock on Rocky Linux 8

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

sudo dnf remove gmock

gmock Package Contents on Rocky Linux 8

/usr/lib/.build-id
/usr/lib/.build-id/43
/usr/lib/.build-id/43/2290661d25d6b3bfbbbba17a7e863531aef4b9
/usr/lib/.build-id/e9
/usr/lib/.build-id/e9/b1740d0334dafff26dc867389ea5bef21bd0f9
/usr/lib/libgmock.so.1.8.0
/usr/lib/libgmock_main.so.1.8.0
/usr/share/licenses/gmock
/usr/share/licenses/gmock/LICENSE
/usr/lib/.build-id
/usr/lib/.build-id/5d
/usr/lib/.build-id/5d/3f381ccbfd7b2d54476f5dd4682e8d265e2e32
/usr/lib/.build-id/c5
/usr/lib/.build-id/c5/e152fc1bea8461403314dca51fd1e1a27b58b0
/usr/lib64/libgmock.so.1.8.0
/usr/lib64/libgmock_main.so.1.8.0
/usr/share/licenses/gmock
/usr/share/licenses/gmock/LICENSE

References

Summary

In this tutorial we learn how to install gmock on Rocky Linux 8 using yum and dnf.