New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS2015/2017 build fix and enable C++11 features #811
Conversation
@@ -71,7 +71,7 @@ | |||
TypedTest/0\. # TypeParam = (VeryLo{245}|class VeryLo{239})\.\.\. | |||
TestA | |||
TestB | |||
TypedTest/1\. # TypeParam = int\s*\* | |||
TypedTest/1\. # TypeParam = int\s*\*( __ptr64)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a lot going on here that isn't technically necessary.
I would like to have some idea of what's being changed but I can't review all of this at once.
Can you write a little in the "conversation" tab about what exactly is being changed and why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit disappear after you merge PR #723. So ignore this commit here.
Specifically, these changes correct VC++ 64-bit tests
I'm curious about something. We used to rely on CMake to auto-generate our Visual Studio solution and project files. Are we no longer doing that? |
@@ -355,7 +355,9 @@ | |||
#if GTEST_STDLIB_CXX11 | |||
# define GTEST_HAS_STD_BEGIN_AND_END_ 1 | |||
# define GTEST_HAS_STD_FORWARD_LIST_ 1 | |||
# define GTEST_HAS_STD_FUNCTION_ 1 | |||
# if !defined(_MSC_VER) || (_MSC_FULL_VER >= 190023824) // works only with VS2015U2 and better | |||
# define GTEST_HAS_STD_FUNCTION_ 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS2015 without updates doesn't support all required std::function features
@coreykosak I only want support old projects for old VS (2010 and less), because some users depend on them. Old VS projects cannot run tests. New users should use CMake generated projects. But now we have VS2015 projects #773 😞 |
I guess I don't understand the full story. CMake should be able to generate projects for any Visual Studio version, and it can support conditionals to enable or disable tests on some versions. This is my assumption anyway. I haven't actually tried it. |
Yes you right, but some people prefer don't use CMake and they use old projects. |
I agree. Sorry, I didn't say my whole thought, which is. Even if we publish the solution and project files for all VS versions (and I think we should), those files should be generated by CMake, not hand-edited. Put another way, our job is to get CMakeLists.txt right, run it for all the versions, and then publish the result. |
@BillyDonahue anything else is not clear in this PR? |
@BillyDonahue any news? I promise that when we will fix VS 2015 build I stop posting messages there 😄 |
@@ -515,7 +515,7 @@ template <typename T, typename M> | |||
class MatcherCastImpl { | |||
public: | |||
static Matcher<T> Cast(const M& polymorphic_matcher_or_value) { | |||
// M can be a polymorhic matcher, in which case we want to use | |||
// M can be a polymorphic matcher, in which case we want to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not an MSVC build fix.
Please narrow your changes down for review.
If you want to fix spelling errors, do it separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Rebased to remove changes which were in PR #821 |
@BillyDonahue Do I need remove anything else from PR? |
// Determines if unordered_map/unordered_set are available. | ||
// Only used for testing against those containers. | ||
#if !defined(GTEST_HAS_UNORDERED_MAP_) | ||
# if defined(_MSC_VER) && (_MSC_VER >= 1900) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::unordered_set and std::unordered_map tests should also be enabled on other platforms, I would say this check should be #if GTEST_LANG_CXX11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somebody can try do that in separate PR. I am trying to merge this changes since 23 February 😄
46c636c
to
87b1cf0
Compare
@BillyDonahue PR now has only one commit. VS2010 solution changes moved to separate PR. |
ba08175
to
1695708
Compare
I agree with @coreykosak: cmake should be used to detect what the compiler supports, instead of adding conditional macro logic in gtest include files. If somebody is using _old_version of VS and doesn't want to run cmake, why don't they simply use an old version of gtest? :-) |
I don't add it. I just update currently used If you know how to do that, patches welcome. |
Why do we have to do it, if condional macro works pretty fine for all use cases? |
6c64f2a
to
c3685ac
Compare
Patch by KindDragon from google/googletest#811
Patch by KindDragon from google/googletest#811
Patch by KindDragon from google/googletest#811
Patch by KindDragon from google/googletest#811
This looks somewhat messy, a lot of conversation, merge conflicts now. |
Depend on PR #723
Commit 1695708 allow use C++11 features available in VS2015, fix failed tests with GMock under VC++2015 compiler