-
Notifications
You must be signed in to change notification settings - Fork 1k
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
cmake: Clean up testing code #1554
cmake: Clean up testing code #1554
Conversation
The `CTest` module handles `CDash` integration, which we do not use. It is not required for testing functionality.
I don't think it's required. It's just that
|
This change simplifies the code. Also comments has been added to highlight the code structure.
526a5df
to
7c987ec
Compare
I agree.
Sure. The code has been adjusted.
I did some research and I haven't found any drawbacks. When It is recommended:
|
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.
utACK 7c987ec
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.
ACK 7c987ec
I don't have too much knowledge about CMake, but following the discussion here and reading some CMake forum discussions (e.g. https://discourse.cmake.org/t/is-there-any-reason-to-prefer-include-ctest-or-enable-testing-over-the-other/1905/2), the simplification looks correct.
I did some research and I haven't found any drawbacks. When enable_testing() is invoked and no tests being added, the created CTestTestfile.cmake files in the binary tree are noop/empty.
Verified this by creating a fresh build directory via
$ rm -rf ./build && cmake -B build -DSECP256K1_BUILD_BENCHMARK=OFF -DSECP256K1_BUILD_TESTS=OFF -DSECP256K1_BUILD_EXHAUSTIVE_TESTS=OFF -DSECP256K1_BUILD_CTIME_TESTS=OFF
$ cat ./build/src/CTestTestfile.cmake
and checking that the file only contains comment. If one of these options is ON, the file contains add_test(...)
calls.
CTest
module.The
CTest
module handlesCDash
integration, which we do not use. It is not required for testing functionality.enable_testing()
The
enable_testing()
command invocation is required foradd_test()
commands, which are used only for{noverify_}tests
,exhaustive_tests
and examples.