GoogleTest provided with C/C++test CT can be easily integrated with modern C++ build systems. Quick-start guides for integrating GoogleTest with popular build systems are available in the GoogleTest documentation. To access the documentation, extract the contents of the <INSTALL_DIR>/googletest/googletest.zip package.
Building with Bazel
See docs/quickstart-bazel.md in the provided GoogleTest documentation for a quick-start guide.
Building with CMake
See docs/quickstart-cmake.md in the provided GoogleTest documentation for a quick-start guide.
Integrating GoogleTest Provided with C/C++test CT
To integrate the provided GoogleTest package with your project, consider one of the following options:
- Extract the contents of the
<INSTALL_DIR>/googletest/googletest.zippackage and build the GoogleTest framework locally. - Point your build system to the
<INSTALL_DIR>/googletest/googletest.zippackage location. - Host the provided GoogleTest package on a shared network location and access it via a URL in your build configuration.
Example:
For CMake projects, you can add the following snippet to your CMakeLists.txt file to access the GoogleTest package provided with C/C++test CT:
FetchContent_Declare( googletest # Assuming C/C++test CT is installed in /opt/parasoft/cpptest-ct URL /opt/parasoft/cpptest-ct/googletest/googletest.zip )
For an example integration, see the <INSTALL_DIR>/examples/CovGoogleTest/CMakeLists.txt file.