secp256k1
secp256k1 copied to clipboard
cmake: Clean up testing code
- Delete
CTestmodule.
The CTest module handles CDash integration, which we do not use. It is not required for testing functionality.
- Clean up cases when to invoke
enable_testing()
The enable_testing() command invocation is required for add_test() commands, which are used only for {noverify_}tests, exhaustive_tests and examples.
The
enable_testing()command invocation is required foradd_test()commands, which are used only for{noverify_}tests,exhaustive_testsand examples.
I don't think it's required. It's just that add_test() has no effect without enable_testing().
enable_testing() seems cheap. Couldn't we just run it always? Or do you think this has drawbacks?
The
enable_testing()command invocation is required foradd_test()commands, which are used only for{noverify_}tests,exhaustive_testsand examples.I don't think it's required. It's just that
add_test()has no effect withoutenable_testing().
enable_testing()seems cheap.
I agree.
Couldn't we just run it always?
Sure. The code has been adjusted.
Or do you think this has drawbacks?
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.
It is recommended:
to call
enable_testing()somewhere in the top levelCMakeLists.txtfile. This would typically be done early, soon after the firstproject()call.