Steps to use the GoogleTest Framework

Environment Setup used :

  • Host operating system : Linux, macOS, Windows

  • Compilersgcc 5.0+ ,clang 5.0+, MSVC 2015+

    ◦ macOS users: Xcode 9.3+ provides clang 5.0+.

  • Os in virtual machine : Ubuntu 18.04 (64-bit)

Installation:

  • Install the googletest development package using the below command.

    ◦ sudo apt-get install libgtest-dev

  • GoogleTest includes a CMake build script that works on a variety of platforms.

    ◦ sudo apt-get install cmake

Features:

  • An xUnit test framework.

  • Test discovery.

  • A rich set of assertions.

  • User-defined assertions.

  • Death tests.

  • Fatal and non-fatal failures.

  • Value-parameterized tests.

  • Type-parameterized tests.

  • Various options for running the tests.

  • XML test report generation.

Incorporating Into An Existing CMake Project

  • The CMakeLists.txt can be updated with the below code to integrate googletest on to an existing project

../_images/GoogleTestCMAKE.png

Steps to Enable TestSuit

  1. Go to Build folder

  2. When trying to cmake the project use the below command ,it will enable the testsuit

    ◦ cmake .. -DENABLE_GTEST_LIDAR_TEST_SUIT=True

GIT Respositry