Skip to content
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

Test with recent GTest versions #1666

Merged
merged 3 commits into from Dec 9, 2022
Merged

Conversation

thetic
Copy link
Contributor

@thetic thetic commented Nov 4, 2022

I am very skeptical of these results. I don't claim to understand autotools. Could you verify that this is exercising everything it should? I noticed some related code was commented out in:

@coveralls
Copy link

coveralls commented Nov 4, 2022

Coverage Status

Coverage remained the same at 99.323% when pulling 7c45bff on thetic:back-to-the-future into 7a7200e on cpputest:master.

@basvodde
Copy link
Member

basvodde commented Nov 4, 2022

I think so. 2014 is a while ago, but if I look at these and the comments (and think back on it) I think these were my unfinished attempts to have the GMock tests themselves run in CppUTest. I vague remember that that led to some incompatabilities (e.g. things like the death tests in GMock that we don't have (don't want to have) in CppUtest).

I am not sure the new GTest versions will be working though. In the past, every gtest version there was some work (read: hacking) to get that to work.

@thetic
Copy link
Contributor Author

thetic commented Nov 4, 2022

Are CppUTest's tests sufficient to validate the GTest integration?

@basvodde
Copy link
Member

basvodde commented Nov 7, 2022

They are invalid to test is all of GTest functionality works within CppUTest.

What the CppUTest/GTest integration does is that it tries to discover the GTests that are linked in the same binary and wraps them around a CppUTest TestShell. It also takes over the GMock assertion handler if I'm right. That way it can execute GTest cases as if they are CppUTest cases.

However, that does not test all the Gtest/GMock functionality within CppUTest. In order to do that, it would be better to take the GTest self-tests and run those in CppUTest. That failed on some functionality, which means that any basic usages of GTest within CppUTest will work... but that some functionality might cause problems.

For me, at the time of writing it, that was good enough and I didn't continue it further. It was also hard since GTest isn't really build to be part of another test runner, so it is definitively a hack on the GTest-side, which is why it has traditionally not been easy to adopt a new version. That said, I guess that part of Gtest doesn't change that often...

@thetic
Copy link
Contributor Author

thetic commented Nov 7, 2022

Thank you. That was very helpful.

@thetic
Copy link
Contributor Author

thetic commented Nov 12, 2022

Is there any value in merging this given your points?

@thetic
Copy link
Contributor Author

thetic commented Nov 12, 2022

[Existing automation] does not test all the Gtest/GMock functionality within CppUTest. In order to do that, it would be better to take the GTest self-tests and run those in CppUTest. That failed on some functionality, which means that any basic usages of GTest within CppUTest will work... but that some functionality might cause problems.

It sounds like we could use some integration tests that exercise the subset of functionality that we expect to work.

@basvodde
Copy link
Member

Yes, I think so. The GTestTests ought to have some GTest tests that ought to be run in CppUTest. If they pass then the basic GTest/GMock functionality ought to work in CppUTest.

In my experience, for most Gtest-test-sets, they don't use more than the basic functionality anyways, so it is fine.

@thetic thetic marked this pull request as ready for review November 14, 2022 09:48
@basvodde basvodde merged commit 9a75163 into cpputest:master Dec 9, 2022
@thetic thetic deleted the back-to-the-future branch December 10, 2022 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants