How To Install gtest on Fedora 34

gtest is Google C++ testing framework Google C++ testing framework

Introduction

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

What is gtest

Framework for writing C++ tests on a variety of platforms (GNU/Linux, Mac OS X, Windows, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, various options for running the tests, and XML test report generation. gtest 1.10.0 6.fc34 x86_64 155 k gtest-1.10.0-6.fc34.src.rpm updates Google C++ testing framework https BSD and ASL 2.0 Framework for writing C++ tests on a variety of platforms (GNU/Linux, Mac OS X, Windows, Windows CE, and Symbian). Based on the xUnit architecture. Supports automatic test discovery, a rich set of assertions, user-defined assertions, death tests, fatal and non-fatal failures, various options for running the tests, and XML test report generation.

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

Install gtest 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 gtest using dnf by running the following command:

sudo dnf -y install gtest

Install gtest 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 gtest using yum by running the following command:

sudo yum -y install gtest

How To Uninstall gtest on Fedora 34

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

sudo dnf remove gtest

gtest Package Contents on Fedora 34

/usr/lib/.build-id
/usr/lib/.build-id/24
/usr/lib/.build-id/24/0c0aacff2a0616407dc025623145f775aeaab6
/usr/lib/.build-id/fc
/usr/lib/.build-id/fc/6dc364d01d71993370a20138bc5e959d76ddb7
/usr/lib64/libgtest.so.1.10.0
/usr/lib64/libgtest_main.so.1.10.0
/usr/share/licenses/gtest
/usr/share/licenses/gtest/LICENSE
/usr/lib/.build-id
/usr/lib/.build-id/3b
/usr/lib/.build-id/3b/6d7f8656b00f118438ec780385041ce092cb2f
/usr/lib/.build-id/8f
/usr/lib/.build-id/8f/aaf57c6d6a477345f55c6e40500ab4f356d6a4
/usr/lib/libgtest.so.1.10.0
/usr/lib/libgtest_main.so.1.10.0
/usr/share/licenses/gtest
/usr/share/licenses/gtest/LICENSE
/usr/lib/.build-id
/usr/lib/.build-id/3d
/usr/lib/.build-id/3d/66a9e26dc216ef981d6b80d62d6ddfaed89c6e
/usr/lib/.build-id/c5
/usr/lib/.build-id/c5/6aa5d6e7e7396e6267133f742cef16eb2485b7
/usr/lib/libgtest.so.1.10.0
/usr/lib/libgtest_main.so.1.10.0
/usr/share/licenses/gtest
/usr/share/licenses/gtest/LICENSE
/usr/lib/.build-id
/usr/lib/.build-id/50
/usr/lib/.build-id/50/8822a719a86f62d0c7a44f42fdcb61b2106ee8
/usr/lib/.build-id/c2
/usr/lib/.build-id/c2/2a218ae585f0e828f1f2a6c75583b36733a47c
/usr/lib64/libgtest.so.1.10.0
/usr/lib64/libgtest_main.so.1.10.0
/usr/share/licenses/gtest
/usr/share/licenses/gtest/LICENSE

References

Summary

In this tutorial we learn how to install gtest on Fedora 34 using yum and dnf.