Installing Google Test For Linux - iat-cener/tonatiuh GitHub Wiki
Installing GTest for Linux
GoogleTest is a framework based on the xUnit architecture. This framework is to write test for C++ code and valid for the most common platforms. Installation
CMake
To build and install goolge test library, first, we must install cmake in our development environment.
- Before installing, it is a good practice to update the package list:
sudo apt-get update
- Use the following command to install it:
sudo apt-get install cmake
GoogleTest
Now, continue installing GTest from the official repositories.
- Download the code:
sudo apt-get install libgtest-dev
- Go to the code folder
cd /usr/src/gtest
- Configure and build the library:
sudo cmake CmakeLists.txt
sudo make
- Copy some files to required folder for use with Tonatiuh:
sudo cp lib/libgtest*.a /usr/lib
sudo mkdir /usr/local/lib/gtest
sudo ln -s /usr/lib/libgtest.a /usr/local/lib/gtest/libgtest.a
sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/gtest/libgtest_main.a