Test with newer compilers in CI
[alexxy/gromacs.git] / src / external / googletest / README.Gromacs
1 This directory contains source code for Google C++ Testing and Mocking
2 Frameworks.
3
4 The code has been copied nearly verbatim from the GoogleTest 1.8.1
5 git tag by copying the following files/directories recursively:
6
7 README.md
8 googletest
9 googlemock
10
11 However, the following files/subdirectories were excluded because they
12 are unneeded for GROMACS:
13
14 *.pump
15 googletest/configure.ac
16 googletest/Makefile.am
17 googletest/codegear
18 googletest/msvc
19 googletest/m4
20 googletest/xcode
21 googletest/test
22 googletest/scripts
23 googletest/samples
24
25 This README.Gromacs file is new, of course.
26
27 The top-level CMakeLists.txt has enable_testing() commented out, as we
28 do not intend to test GoogleTest as part of a GROMACS build.
29
30 The CMakeLists.txt files in googletest and googlemock have declared
31 their include directories as SYSTEM INTERFACE (not just INTERFACE) so
32 that compilers will include such headers with e.g. -isystem, so that
33 they will not generate warnings from such headers included in GROMACS
34 test code.
35
36 As gtest is not building libraries inside googletest/googletest/src,
37 the link_directories command for that is removed.
38
39 The googlemock/CMakeLists.txt no longer builds
40 googletest/src/gtest-all.cc as part of the gmock target, because it is
41 already built as part of the gtest target, and this leads to duplicate
42 definitions of extern symbols declared in gtest headers. Added the
43 link-time dependency of gmock upon gtest that is now required.
44
45 The gmock_main executables and library are not created,
46 because GROMACS does not use them.
47
48 googletest-1.8.0 also assumes that streaming results to a socket is
49 something you can always do on Linux, but the implementation uses
50 getaddrinfo(), about which the Cray linker warns because its use would
51 require shared libraries at run time. Since GROMACS testing doesn't
52 use this feature, we'd just want to turn it off, but there's no
53 interface for that. So, GTEST_CAN_STREAM_RESULTS is added in
54 googletest/include/gtest/internal/gtest-port.h to allow the default
55 behaviour to be applied only if the user hasn't gotten involved.
56
57 Some compiler warnings cannot be suppressed through CMake machinery,
58 such as for the clang static analyzer, and some lines are removed
59 from consideration by wrapping with `#ifndef __clang_analyzer__`
60 or marking them with `/*NOLINT*/` comment.
61 ... `#endif`. A suppression is added to internal_utils.cmake.
62
63 GoogleTest declares quite old minimum CMake versions, which newer
64 CMake versions warn about. In practice, the CMake version requirement
65 for GROMACS is greater than these minimums, and that version will be
66 used for GoogleTest also. The warnings aren't useful for GROMACS
67 developers, so those declarations by GoogleTest have been commented
68 out.