[BUG] Compiling an Unit Test fails with errors
christophKaiser opened this issue · comments
Describe the bug
Since the update to VS2019, compiling an Unit Test brings up the following error list:
To Reproduce
Steps to reproduce the behavior:
- In the Solution Explorer of Visual Studio 2019, go to
OpenInfraPlatform/UnitTests/Schamas/IFC4x1
- Build one of the unit tests, in my example it's
bspline-surface-with-knots
(the unit testfixed-refernce-swept-area-solid
brings up a similar list of errors)
Additional context
According to https://en.cppreference.com/w/cpp/types/result_of, std::result_of
was removed by C++20 and replaced with std::invoke_result
since C++17.
The file in which the error occurs is located at <build folder>\_deps\dep_gtest-src\googlemock\include\gmock\gmock-actions.h
.
I did further investigations: Our current version of googletest is 1.10.0 with the code
https://github.com/google/googletest/blob/703bd9caab50b139428cea1aaff9974ebee5742e/googlemock/include/gmock/gmock-actions.h#L819
In the newer release 1.11.0, this line of code is changed to
https://github.com/google/googletest/blob/d61d4d8e64c08a662055e82904bbf90e108a704f/googlemock/include/gmock/gmock-actions.h#L953-L954
I guess we should update google test then.
I will take a look at it as soon as I find time.
To update google test, probably we have to change in /UnitTests/CMakeListis.txt the line 23 from
GIT_TAG release-1.10.0
to
GIT_TAG release-1.11.0
.
However, even after this change gtest 1.10.0 is downloaded by the BlueFramework - see file <build-folder>\_deps\blue_framework-src\UnitTests\CMakeLists.txt
, line 22. This happens before the unit tests of OIP want to download gtest (allmost at the end of CMake Configure), which causes no download of gtest 1.11.0 by unit tests of OIP (because some kind of gtest allready exists).
Yes the GIT_TAG is what we need to change.
Generally it's also no problem to make changes to the Blueframework.
We have to see if the update of gtest will require further changes to other parts of the code.