Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Fix CMake tests handling. BUILD_TESTS + add_subdirectory -> cm_add_test_subdirectory #146

Open
x-mass opened this issue Feb 13, 2024 · 2 comments

Comments

@x-mass
Copy link
Member

x-mass commented Feb 13, 2024

Currently entire project uses CMTest not as is has to. All around CMake files you could meet sth like:

if(BUILD_TESTS)
  add_subdirectory(tests)
endif()

But if we read documentation for CMTest, it turns out BUILD_TESTS should be used to either include tests to all target or not.
At the same time, test dirs should be added as cm_add_test_subdirectory(test_subdir) and enabled with CMAKE_ENABLE_TESTS.

Ran into this issue while trying to install crypto3 with make install. Now it installs tests as well, which is not expected. Not sure if this change will affect install target though

@x-mass
Copy link
Member Author

x-mass commented Feb 20, 2024

In addition, submodules do not propagate their tests to crypto3, thus we can't run make test.
Will be fixed with BoostCMake/cmake_modules#23

@AndreyMlashkin
Copy link
Contributor

seems to be fixed

AndreyMlashkin pushed a commit that referenced this issue Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants