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

Testssuite fails to build: it can't find googletest #551

Closed
yurivict opened this issue Jan 10, 2023 · 12 comments · Fixed by #552
Closed

Testssuite fails to build: it can't find googletest #551

yurivict opened this issue Jan 10, 2023 · 12 comments · Fixed by #552

Comments

@yurivict
Copy link

===>  Testing for ftxui-3.0.0.69
-- clang-tidy not found.
CMake Error at cmake/ftxui_test.cmake:18 (add_subdirectory):
  add_subdirectory given source
  "/usr/ports/devel/ftxui/work/FTXUI-3.0.0-69-g90dfcee/_deps/googletest-src"
  which is not an existing directory.
Call Stack (most recent call first):
  CMakeLists.txt:149 (include)


CMake Error at cmake/ftxui_benchmark.cmake:13 (add_subdirectory):
  add_subdirectory given source
  "/usr/ports/devel/ftxui/work/FTXUI-3.0.0-69-g90dfcee/_deps/googlebenchmark-src"
  which is not an existing directory.
Call Stack (most recent call first):
  cmake/ftxui_test.cmake:83 (include)
  CMakeLists.txt:149 (include)


-- Configuring incomplete, errors occurred!

googletest doesn't get fetched, and it doesn't use the pre-installed googletest either.

Version: 3.0.0-69-g90dfcee
clang-14
FreeBSD 13.1

@ArthurSonzogni
Copy link
Owner

googletest are fetched for you. No problem with this library.

The problem is that you enabled the option:
FTXUI_CLANG_TIDY

And you don't have clang tidy installed.

@ArthurSonzogni
Copy link
Owner

I should probably check for clang tidy and add a better error message to explain what happened.

@yurivict
Copy link
Author

yurivict commented Jan 10, 2023

No, I didn't enable FTXUI_CLANG_TIDY.

@ArthurSonzogni
Copy link
Owner

Okay. Then, I will take a look more closely. Thanks for reporting this!

@arrowd
Copy link

arrowd commented Jan 10, 2023

@yurivict This might has something to do with the fact that our cmake.mk always passes -DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON in CMAKE_ARGS.

@yurivict
Copy link
Author

It should be possible to build tests with pre-installed googletest.

@arrowd
Copy link

arrowd commented Jan 10, 2023

Yes, sure, I'm just guessing why @ArthurSonzogni may not seen this before.

@yurivict
Copy link
Author

I see.

@ArthurSonzogni
Copy link
Owner

It should be possible to build tests with pre-installed googletest.

Note that:

  • gtest from packages does not come with GTestConfig.cmake to find the library.
  • New versions of CMake provide it, but it means I would have to drop support for developers using older cmake version. The first LTS ubuntu release with the required cmake version is the 22.04 one. It might be a little bit too early today.
  • The official docs suggest using FetchContent.

This answer might change the tradeoff we are willing to make: Why do you need to build tests and can't use cmake fetchcontent?

@yurivict
Copy link
Author

gtest from packages does not come with GTestConfig.cmake to find the library.

Yes it does:

$ pkg info -l googletest | grep GTestConfig
	/usr/local/lib/cmake/GTest/GTestConfig.cmake
	/usr/local/lib/cmake/GTest/GTestConfigVersion.cmake

It can be made optional to use externally installed GTest.

@ArthurSonzogni
Copy link
Owner

Not on my distribution unfortunately:
https://packages.ubuntu.com/jammy/all/googletest/filelist

If you want, I can add optional support, but I won't be able to test locally. I will make a patch and let you confirm it worked.

ArthurSonzogni added a commit that referenced this issue Jan 11, 2023
Some developers would be happier with the gtest version provided from
their package manager. Use it if it is installed the package provide
cmake support.

Fixed: #551
@ArthurSonzogni
Copy link
Owner

@yurivict / @arrowd
Could you please confirm this fixes: #551

(I can't test it locally myself, because the ubuntu package manager do not provide the proper cmake finder)

ArthurSonzogni added a commit that referenced this issue Jan 12, 2023
Some developers would be happier with the gtest version provided from
their package manager. Use it if it is installed the package provide
cmake support.

Fixed: #551
ArthurSonzogni added a commit that referenced this issue Jan 12, 2023
Some developers would be happier with the gtest version provided from
their package manager. Use it if it is installed the package provide
cmake support.

Fixed: #551
ArthurSonzogni added a commit that referenced this issue Jan 14, 2023
Some developers would be happier with the gtest version provided from
their package manager. Use it if it is installed the package provide
cmake support.

Fixed: #551
ArthurSonzogni added a commit that referenced this issue Jan 14, 2023
Some developers would be happier with the gtest version provided from
their package manager. Use it if it is installed the package provide
cmake support.

Fixed: #551
ArthurSonzogni added a commit that referenced this issue Jan 14, 2023
Some developers would be happier with the gtest version provided from
their package manager. Use it if it is installed the package provide
cmake support.

Fixed: #551
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 a pull request may close this issue.

3 participants