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
Use an external GoogleTest #26
Conversation
Look for external sources of GoogleTest by reading the GTEST_ROOT cmake variable, and enable the elektratools tests based on whether GTEST_ROOT points to a valid GoogleTest source directory. Integrate the provided cmake stuff of GoogleTest to build with the own tests.
No more needed now, since an external version is always looked for.
As Felix (Github User fberlakovich) told me it can cause problems to use gtest not compiled with exactly the same compiler flags. Most distros supply already compiled versions of gtest that might be compiled differently. We could support both variants: if the user wants to use the installed version it will be used and otherwise the embedded copy will be used. What do you think? |
I think pino suggests a way to use installed gtest sources and not the compiled library. Many distros (e.g. debian) ship with the gtest sources. If this works reliably it is definitely preferrable to shipping with the gtest sources. However, this elimantes the option to build the tests out of the box (without user interaction). From what I saw, the flag is |
Exactly.
And eliminates also the embedded copy of some 3rd party source, which is usually a Bad Thing (tm).
|
I full agree that it is a bad thing to deliever foreign source, but I could not find gtest as source in neither Arch Linux nor Fedora. If most of the major distros do it the debian way (have a package for gtest-source), I am the first to remove our embedded copy. But even Debian Wheezy seems not to have it. @fberlakovich can you re-check which distros have it. @pinotree what do you think about updating our CMake to use installed gtest-source if requested by CMake Variable? Btw. the ongoing decision process is documented here. |
In Debian it is called
Isn't that what this merge request already does, e.g. passing Note also this is about using some external gtest -- it does not imply it must be packaged somewhere by your distro (if any), but simply that the gtest sources are outside the elektra sources. |
Thanks for your effort, most of it was taken for dae461e Internal variant of gtest was stripped down, but it will stay for some time because nearly all systems, except of debian, do not provide an easy way to install gtest sources. |
This will surely not give an incentive to those distros to provide the gtest sources (as also upstream currently recommends, until they change again their mind...). Also, not all the distros even compile or run the upstream tests during the build, and gtest surely is not needed for building elektra. Further, for developers My advice is still to get rid of any embedded 3rd party source code copy, which always adds an additional maintaneance burden. |
No, it is not needed for building it, but the idea is that it will become more important for testing it. I personally find the incentive for testing the software (make it as easy as possible), more important than giving incentives for doing proper software distribution.
I am fully aware for that. This is good for developers (and thus your suggestion is supported as is: so one can set GTEST_ROOT and the code from there will be preferred). It cannot be used for automatical building with packages only, but instead it needs one manual step or one step to download 3rd party sofware. And I really do not want to split testcases that will always run (not depending on gtest) and those that need gtest and might not run if the user does not do the
You are right and I fully agree that it is not perfect. But for our project it is more important that users easily can run all testcases without any manual step than it is to evangelize proper software distribution. Elektra currently is too small for such a thing anyway :-) |
Look for external GoogleTest sources, which can be specified passing
-DGTEST_ROOT=path
to cmake.This avoids the use of an embedded copy of gtest, which is now removed.